Josif_tepe

Untitled

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