Advertisement
Josif_tepe

Untitled

Mar 19th, 2021
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.83 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int a, b;
  7.     cin >> a >> b;
  8.     int promeni = 0;
  9.     for(int i = 0; i < 10; i++){
  10.         b += 1;
  11.         if(b == 60) {
  12.             promeni += 2;
  13.             b = 0;
  14.             if(a == 23) {
  15.                 a = 0;
  16.                 promeni += 2;
  17.             }
  18.             else if(a == 9) {
  19.                 promeni += 2;
  20.                 a += 1;
  21.             }
  22.             else if(a == 19){
  23.                 promeni += 2;
  24.                 a += 1;
  25.             }
  26.             else {
  27.                 promeni += 1;
  28.                 a += 1;
  29.             }
  30.         }
  31.         else if((b - 1) % 10 == 9) {
  32.             promeni += 2;
  33.         }
  34.         else {
  35.             promeni += 1;
  36.         }
  37.        
  38.     }
  39.     cout << promeni << endl;
  40.     return 0;
  41. }
  42. // 19 --> 20
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement