| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
怎么是 wrong answer啊? 我调试的时候 明明没有问题的……#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
long i;
int j,k,a,b;
while(1)
{
k=1;
scanf("%d",&i);
if(i<0)break;
if(i==1){printf("YES\n");break;}
for(j=2;;j++)
{
a=1;
for(b=j;b>0;b--)
{
a=a*b;
}
k+=a;
if(k>i){printf("NO\n");break;}
if(k==i){printf("YES\n");break;}
}
}
system("PAUSE");
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator