标题:搞不懂
取消只看楼主
谌俭
Rank: 1
等 级:新手上路
帖 子:52
专家分:0
注 册:2008-10-11
 问题点数:0 回复次数:0 
搞不懂
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)
    {
        
        y=fac(N);
        cout<<y<<endl;
    }
    return 0;
}
我们学校网页里面编程练习的题,为什么在编译器上运行没问题,在那里提交就说wrrong  anwser呢??
搜索更多相关主题的帖子: include process Memory Java file 
2008-10-15 21:29



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-238521-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.111445 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved