Hi all !!
This is the first good program I try to submit, it works perfectly on my computer, but I always have a "wrong answer" message, please tell me why it is not accepted....
(should I use "fprintf" & fscanf" so that I can read/write the input/output in an external file ???)
Thanks !
#include <stdio.h>
int main(void)
{
int n,i;
scanf("%d",&n);
int *list;
list=(int*)malloc(n*sizeof(int));
double a;
for(i=0;i<n;i++) scanf("%d",&list[i]);
for(i=0;i<n;i++)
{
if(list[i]==0)
printf("1\n");
else
{
a=list[i];
while(list[i]>1)
{
a=a*(list[i]-1),
list[i]--;
}
printf("%1.f\n",a);
}
}
return 0;
}