Advertisement
adventuretimeh

tempo trascorso

Nov 28th, 2019
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  5.  
  6. int main(int argc, char *argv[]) {
  7. int h1,h2,m1,m2,diff_o,m_diff;
  8. printf ("h1");
  9. scanf("%d",&h1);
  10. printf ("h2");
  11. scanf("%d",&h2);   
  12. printf ("m1");
  13. scanf("%d",&m1);
  14. printf ("m2");
  15. scanf("%d",&m2);
  16. m1=h1*60+m1;
  17. m2=h2*60+m2;
  18. diff_o=m_diff/60;
  19. m_diff=m_diff%60;
  20. printf("tempo trascorso %d",h1,h2,m1,m2,diff_o,m_diff);
  21.    
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement