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?#include<stdio.h> main() { int a[10],b[10],c[10],d[10],i,j,k; for(i=0;i<10;i++) { scanf("%d %d %d %d",&a[i],&b[i],&c[i],&d[i]); if(a[i]==-1&&b[i]==-1&&c[i]==-1&&d[i]==-1) break; } for(j=0;j<=i-1;j++) { for(k=33;k<=21252;k++) { if( (k+d[j]-a[j])%23==0&&(k+d[j]-b[j])%28==0&&(k+d[j]-c[j])%33==0 ) break; } printf("Case %d: the next triple peak occurs in %d days.\n",j+1,k); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator