For the problem named ‘Small Factorials’ my solution is giving correct results every time but on submitting the code it shows wrong answer. Please Help.

#include <bits/stdc++.h>

using namespace std;

int factorial (int a)

{

int x=1;

while (a>=1)

{

x *= a;

a–;

}

return x;

}

int main()

{

int n;

cin>>n;

int arr[n];

```
if (n>=1 && n<=100)
{
for (int i=0; i<n; i++)
{
int a;
cin>>a;
if(a>=1 && a<=100) {arr[i] = factorial(a);}
else {arr[i] = a;}
}
for (auto i : arr)
cout<<i<<endl;
}
return 0;
```

}