/ 科创班 /

记录详情

Time Exceeded


  
# 状态 耗时 内存占用
#1 Time Exceeded ≥1006ms ≥256.0 KiB
#2 Accepted 2ms 256.0 KiB
#3 Accepted 2ms 204.0 KiB
#4 Accepted 2ms 256.0 KiB
#5 Accepted 2ms 256.0 KiB
#6 Accepted 2ms 256.0 KiB
#7 Accepted 2ms 256.0 KiB
#8 Accepted 2ms 256.0 KiB
#9 Accepted 2ms 256.0 KiB
#10 Accepted 2ms 256.0 KiB

代码

#include<stdio.h>
int factorial (int n);
int main()
{
int n;
scanf("%d",&n);
while (n<=0)
		{
		scanf("%d",&n);
		if(n>0) break;
	}
printf("%d \n",factorial(n)); 
return 0;
}
int factorial(int n)
{
int i,fact=1;
for(i=1;i<=n;i++)
fact = fact*i;
return fact;
}

信息

递交者
类型
递交
题目
求阶乘
题目数据
下载
语言
C
递交时间
2018-06-18 15:43:20
评测时间
2018-06-18 15:45:31
评测机
分数
90
总耗时
≥1028ms
峰值内存
≥256.0 KiB