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;
}
View Code

 

posted @ 2013-06-07 22:17  undefined2024  阅读(155)  评论(0编辑  收藏  举报