fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. int h, m;
  7. int tH, tM, nTime;
  8.  
  9. cin >> h >> m;
  10. if (h == 0) h = 24;
  11.  
  12. tH = h * 60;
  13. tM = tH + m;
  14. nTime = tM - 45;
  15.  
  16. cout << nTime / 60 << " " << nTime % 60;
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 5300KB
stdin
0 50
stdout
24 5