#include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
using namespace std;
int main()
{
int p,e,i,d;
int num, j;
num = 0 ;
while(scanf("%d %d %d %d",&p,&e,&i,&d) && !( p == -1 && e == -1 && i == -1 && d == -1 ))
{
num ++ ;
for ( j = d + 1 ; j < 21252 ; j ++ )
if( (j - p) % 23 == 0 ) break ;
for( ; j < 21252 ; j = j + 23 )
if( (j - e) % 28 == 0 ) break ;
for( ; j < 21252 ; j = j + 23 * 28 )
if( (j - i) % 33 == 0 ) break;
printf("Case %d: the next triple peak occurs in %d days.\n", num , j - d );
}
return 1;
}
第8章例题--生理周期--2977
最新推荐文章于 2019-12-29 15:25:41 发布