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 |
为什么我的程序通不过呢?#include<iostream.h> #include<stdio.h> void main() { int shengti,qinggan,zili,data1,number=0; while(scanf("%d%d%d%d",&shengti,&qinggan,&zili,&data1)==4) { if(shengti==-1&&qinggan==-1&&zili==-1&&data1==-1) break; number++; int data2=zili,data; while(1) { if((data2-shengti)%23==0&&(data2-qinggan)%28==0) break; data2=data2+33; } data=data2-data1; if(data<=0) data=data+21252; printf("Case %d: the next triple peak occurs in %d days.\n",number,data); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator