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 |
大牛帮忙```#include<stdio.h> main() { int a[11],i; a[0]=1; for(i=1;i<11;i++) a[i]=i*a[i-1]; int num,t; scanf("%d",&num); for(;num>=0;) { for(i=1,t=11;i<=t&&t!=1;) { if(num==0){num=2;break;} if(num==a[i]){num=1;break;} if(a[i]>num){num-=a[i-1];t=i-1;i=1;} else i++; } if(num>1)printf("NO\n"); else printf("YES\n"); scanf("%d",&num); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator