Advertisement
esquilo10

URI-Tempo de Jogo

Mar 11th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main (){
  7.     int hi,hf,hj;//hr inicio e hora fim e duração do jogo
  8.     cin >> hi >> hf;
  9.     if(hi>=hf){
  10.     hj = (hf-hi)+24;   
  11.     }
  12.     else{
  13.         hj = hf-hi;
  14.     }
  15.     cout << "O JOGO DUROU " << hj << " HORA(S)" << endl;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement