Advertisement
Josif_tepe

Untitled

Mar 12th, 2024
977
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int vkupno;
  6.     int vkupno2;
  7.     cin >> vkupno;
  8.     vkupno2 = vkupno;
  9.    
  10.     int h = vkupno / 3600;
  11.     vkupno -= h * 3600;
  12.    
  13.     int m = vkupno / 60;
  14.     int s = vkupno % 60;
  15.    
  16.     cout << vkupno2 << " sekundi se " << h << " casovi, " << m << " minuti i " << s << " sekundi" <<endl;
  17.     return 0;
  18. }
  19. // 14500
  20. // 4h --> 4*3600 = 14400
  21.  
  22. // 100 / 60 = 1
  23. // 40
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement