| ||||||||||
| 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 | |||||||||
Re:不可能不对呀?WA 有高手吗In Reply To:不可能不对呀?WA 有高手吗 Posted by:UESTCCommunication at 2008-04-07 14:18:26 结果可能是负的呀.
#include<stdio.h>
int main()
{
int a,b,c,d,x,i;
for(i=1;;i++){x=0;
scanf("%d%d%d%d",&a,&b,&c,&d);
if(a == -1 && b == -1 && c == -1 && d== -1) break;
a=a%23,b=b%28,c=c%33;
for(x=0;;x++)
if(x%23 == a && x%28 == b && x%33 == c) break;
x=x-d;
if(x<=0)x=x+21252;
printf("Case %d: the next triple peak occurs in %d days.\n",i,x);
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator