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

AC

Posted by songslam at 2019-11-19 09:49:44 on Problem 1006
#include <stdio.h>
int main()
{
int a,b,c,d;
int i=0;
int j=0;
while(1)
{
scanf("%d%d%d%d",&a,&b,&c,&d);
if(a!=-1||b!=-1||c!=-1)
{
j+=1;
while(((d-a)%23)!=0||((d-b)%28!=0)||((d-c)%33!=0)||d==0)
{
d+=1;
i+=1;
}
printf("Case %d: the next triple peak occurs in %d days.\n",j,i);
i=0;
}
else
{
break;
}
}
}

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