Advertisement
Guest User

olimpapa

a guest
Oct 23rd, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int A, B, H, Buff;
  6.  
  7. int main()
  8. {
  9.     cin >> H;
  10.     cin >> A;
  11.     cin >> B;
  12.     Buff = H - A;
  13.     Buff = Buff + B;
  14.     while(Buff < 0)
  15.     {
  16.       Buff+=24;
  17.     }
  18.     while(Buff > 23)
  19.     {
  20.       Buff-=24;
  21.     }
  22.     cout << Buff;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement