Sourse Code:
#include<stdio.h>
int main() {
short re; //repeat
scanf("%hd", &re);
short n;
double ans;
for (int i = 1; i <= re; ++i) {
scanf("%hd", &n);
ans = 1;
for (int j = 2; j <= n; ++j) ans *= j;
printf("%.0lf\n", ans);
}
return 0; //successful
}
Tips:
不用高精度,double就能过。