Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(int argc, char** argv) {
- int a,b,c,d;int temp;int sm;
- while(scanf("%d %d %d %d",&a,&b,&c,&d) ){
- if ((a==0) && (b==0) &&(c==0) &&(d==0)){
- break;
- }
- sm=1080;
- /*horario*/
- temp=a-b;
- if (temp<0) temp=temp+40;
- sm=sm+9*temp;
- /*antihorario*/
- temp=c-b;
- if (temp<0) temp=temp+40;
- sm=sm+9*temp;
- /*horario*/
- temp=c-d;
- if (temp<0) temp=temp+40;
- sm=sm+9*temp;
- printf("%d\n",sm);
- }
- return (EXIT_SUCCESS);
- }
Advertisement
Add Comment
Please, Sign In to add comment