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

怎么是 wrong answer啊? 我调试的时候 明明没有问题的……

Posted by jing5923 at 2010-05-03 11:00:20 on Problem 1775
#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:
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