#include
using namespace std;
long int fact(int n);
void fastread(int &number);
int main()
{
int t;
/scanf("%d",&t);/
fastread(t);
for(int i=0;i<t;i++)
{
int n;
long int res;
scanf("%d",&n);
fastread(n);
res = fact(n);
printf("%ld\n",res);
}
}
long int fact(int n)
{
if(n <=1)
return 1;
else
return n*fact(n-1);
}
void fastread(int &number)
{
bool negative = false;
register int c;
number = 0;
c = getchar();
if(c == '-')
{
negative = true;
c = getchar();
}
for(;(c>47 && c<58);c = getchar())
{
number = number*10 + c - 48;
}
if(negative)
number *= -1;
}
On testing with custom input answer is correct while scanning with fastread, but when i submit its showing wrong answer. It was a successfull submission when i submitted with scanf