close

https://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=1491

 

#include <stdio.h>

using namespace std;

int main()
{
    int s,a,b,c,ans;
    while(scanf("%d %d %d %d",&s,&a,&b,&c))
    {
        if(s+a+b+c==0)
            break;

        ans=120+(40+s-a)%40+(40+b-a)%40+(40+b-c)%40;
        printf("%d\n",ans*9);
    }
    return 0;
}

arrow
arrow
    全站熱搜

    楓綺 發表在 痞客邦 留言(0) 人氣()