fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // scan data
  5. int a,b,c,d;
  6. int stop=0;
  7. int degree;
  8. while(stop==0){
  9. scanf("%d%d%d%d",&a,&b,&c,&d);
  10. if(a==0&&a==b&&b==c&c==d)
  11. stop=1;
  12. else{
  13. degree=720;
  14. degree+=9*((a-b+40)%40);
  15. degree+=360;
  16. degree+=9*((c-b+40)%40);
  17. degree+=9*((c-d+40)%40);
  18. printf("%d\n",degree);
  19. }
  20. }
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 5320KB
stdin
0 30 0 30
5 35 5 35
0 20 0 20
7 27 7 27
0 10 0 10
9 19 9 19
0 0 0 0
stdout
1350
1350
1620
1620
1890
1890