| ||||||||||
| 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 | |||||||||
中国剩余定理,参考代码 10行#include "stdio.h"
int main()
{
int a,b,c,d,e=1;
while (scanf("%d %d %d %d",&a,&b,&c,&d)!=EOF&a!=-1)
{
printf("Case %d: the next triple peak occurs in %d days.\n",e++,(a*5544+b*14421+c*1288-d+21252)%21252!=0?(a*5544+b*14421+c*1288-d+21252)%21252:21252);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator