Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

大牛帮忙```

Posted by chiouchiou at 2007-07-11 15:54:15 on Problem 1775
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator