1006

#include <stdio.h>

int main(int ac, char**av)
{
    int a23 = 28 * 33 * 6;
    int a28 = 23 * 33 * 19;
    int a33 = 23 * 28 * 2;
    int a, b, c, s;
    int i = 1;
    while (scanf("%d %d %d %d", &a, &b, &c, &s))
    {
	if (a == -1 || b == -1 )
	    return 0;

	int x = a23 * a + a28 * b + a33 * c + (s / 21252 + 1) * 21252;
	x = x - s;
	x %= 21252;
	if (x == 0)
            x = 21252;
	printf("Case %d: the next triple peak occurs in %d days.\n",
		i++, x);
    }
    return 0;
}


發佈了47 篇原創文章 · 獲贊 0 · 訪問量 6萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章