| ||||||||||
| 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<stdio.h>
int main()
{
int p, e, i, d;
int j, days, x;
scanf( "%d%d%d%d", &p, &e, &i, &d );
j = 0;
while( p != -1 || e != -1 || i != -1 || d != -1 )
{
j++;
for( x = 0; x <= 21252; x++ )
{
if( x > d && x > p && x > e && x > i && (x-p)%23 == 0 && (x-e)%28 == 0 && (x-i)%33 == 0 )
{
days = x-d;
break;
}
}
if( x >21252 )
days = 21252-d;
printf( "Case %d: the next triple peak occurs in %d days.\n", j, days );
scanf( "%d%d%d%d", &p, &e, &i, &d );
}
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator