首页 > 学院 > 开发设计 > 正文

Biorhythms(POJ1006)

2019-11-06 08:35:54
字体:
来源:转载
供稿:网友
# include <stdio.h># include <math.h>int main(){	int p, e, i, d;	int j, count=1;	while(scanf("%d%d%d%d", &p, &e, &i, &d)!=EOF && (p!=-1 || e!=-1 || i!=-1 || d!=-1))	{		for(j=d+1; j<=d+21252; j++)		{			if(abs(j-p)%23==0 && abs(j-e)%28==0 && abs(j-i)%33==0)			{				PRintf("Case %d: the next triple peak occurs in %d days./n", count, j-d);				break;			}			}		count++;	}}
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表