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 |
那我不是很理解,为什么老是WA?#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator