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

那我不是很理解,为什么老是WA?

Posted by tcxgsy at 2005-08-17 20:31:50 on Problem 2590
#define N  10000
#include"stdio.h"

long x,y;
long z;
long n,i,j;

main()
{      scanf("%d",&n);
       for(i=0;i<n;i++)
       {   scanf("%ld%ld",&x,&y);
           z=y-x;
           for(j=1;j<z;j++)
            {  x=x+j;
               if(x>=(y-1)) 
                  { printf("%d\n",j+1);break;}
             }
         }
}
我为什么错呢?

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