Time Exceeded
代码
#include<stdio.h>
int main()
{
int num;
scanf("%d",&num);
while (num<=0)
{
scanf("%d",&num);
}
int Sum=1;
for(int i=1;i<=num;i++)
{
Sum=Sum*i;
}
printf("%d",Sum);
return 0;
}
#include<stdio.h>
int main()
{
int num;
scanf("%d",&num);
while (num<=0)
{
scanf("%d",&num);
}
int Sum=1;
for(int i=1;i<=num;i++)
{
Sum=Sum*i;
}
printf("%d",Sum);
return 0;
}