Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

中国剩余定理,参考代码 10行

Posted by ajianhouyuan at 2010-09-07 14:45:18
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator