poj2304
简单题
#include <iostream> #include <cstdlib> #include <cstring> #include <cstdio> using namespace std; int a, b, c, d; int cal(int a) { return (a + 40) % 40; } int main() { while (scanf("%d%d%d%d", &a, &b, &c, &d), a | b | c | d) { int ans = cal(a - b) + cal(c - b) + cal(c - d) + 120; ans *= 9; printf("%d\n", ans); } return 0; }