#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
using namespace std ;
#define pi 3.1416
#define maximum 1000000
int main()
{
int a,b,c,d ;
while(cin>>a>>b>>c>>d)
{
int m ;
if(a==0&&b==0&&c==0&&d==0)
break ;
int k=720 ;
if(a>b)
{
m = ((a-b)*9) ;
}
else
m = 360 - ((b-a)*9) ;
k = k+m ;
k= k+360 ;
if(b>c)
{
m =360 -(b-c)*9 ;
}
else
m = (c-b)*9 ;
k = k+m ;
if(c>d)
{
m = (c-d) *9 ;
}
else
{
m = 360-((d-c)*9) ;
}
k = k+m ;
printf("%d\n",k) ;
}
return 0 ;
}
#include<cstdio>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
using namespace std ;
#define pi 3.1416
#define maximum 1000000
int main()
{
int a,b,c,d ;
while(cin>>a>>b>>c>>d)
{
int m ;
if(a==0&&b==0&&c==0&&d==0)
break ;
int k=720 ;
if(a>b)
{
m = ((a-b)*9) ;
}
else
m = 360 - ((b-a)*9) ;
k = k+m ;
k= k+360 ;
if(b>c)
{
m =360 -(b-c)*9 ;
}
else
m = (c-b)*9 ;
k = k+m ;
if(c>d)
{
m = (c-d) *9 ;
}
else
{
m = 360-((d-c)*9) ;
}
k = k+m ;
printf("%d\n",k) ;
}
return 0 ;
}
No comments:
Post a Comment