Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
T otal Submission(s): 5900 Accepted Submission(s): 1368
Problem Description
Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N!
Input
One N in one line, process to the end of file.
Output
For each N, output N! in one line.
Sample Input
1
2
3
Sample Output
1
2
6
我的程序:
#include "iostream"
using namespace std;
long fac(int n)
{
long f;
if (n==0||n==1) f=1;
else f=fac(n-1)*n;
return f;
}
int main()
{
int N;
0<=N&&N>=10000;
long y;
while(cin>>N)
{