标签:
无情的选择了一道看似简单的题
结果被教育
#include <stdio.h> int main() { int p, e, i, d, j = 1, day; while ((scanf("%d %d %d %d", &p, &e, &i, &d)) && (p + e + i + d) != -4) { day = (5544 * p + 14421 * e + 1288 * i - d + 21252) % 21252; if (day == 0) { day = 21252; } printf("Case %d: the next triple peak occurs in %d days.\n", j++, day); } } //WC /*#include <stdio.h> int main(){ int a, b, c, d,i,j=1; while ((scanf("%d %d %d %d", &a, &b, &c, &d))&&(a+b+c+d)!=-4){ for (i = 21252; i > 0; i--) if ((i - a) % 23 == 0 && (i - b) % 28 == 0 && (i - c) % 33 == 0) if (i-d) printf("Case %d: the next triple peak occurs in %d days.\n", j++,i-d); else printf("Case %d: the next triple peak occurs in %d days.\n", j++, i - d+21252); } return 0; } */
标签:
原文地址:http://www.cnblogs.com/R7-s/p/4322122.html