-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest3.c
45 lines (38 loc) · 853 Bytes
/
test3.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <stdio.h>
#include <stdlib.h>
int smI,smA,smB,smC,smAnswer;
int readCase(){
scanf("%d%d%d%d\n",&smI,&smA,&smB,&smC);
if((smI == 0) && (smA ==0) && (smB==0) && (smC==0)){
return 0;
}
return 1;
}
void solveCase(){
int smFirstDegree,smSecondDegree,smThirdDegree;
if(smI<smA){
smFirstDegree = 40 + smI - smA;
}else{
smFirstDegree = smI-smA;
}
if(smB<smA){
smSecondDegree = 40 + smB - smA;
}else{
smSecondDegree = smB - smA;
}
if(smB<smC){
smThirdDegree = 40 + smB - smC;
}else{
smThirdDegree = smB - smC;
}
smAnswer = 1080 + 9*(smFirstDegree + smSecondDegree + smThirdDegree);
printf("%d\n",smAnswer);
}
int main()
{
//freopen("input.txt","r",stdin);
while(readCase()){
solveCase();
}
return 0;
}