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;
}
全站熱搜
留言列表