Advertisement
MohamedAbdel3al

B. player and time

Oct 7th, 2021
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std ;
  4. #define sz(s) int(s.size())
  5. #define all(s) s.begin() , s.end()
  6. #define getline(s) getline(cin >> ws, s)
  7. #define cin(v) for (auto& i : v) cin >> i ;
  8. #define cout(v) for (auto& i : v) cout << i << " "
  9. #define pb(x) push_back(x)
  10. #define ll long long
  11. #define ull unsigned long long
  12. #define Mod 1'000'000'007
  13. #define INF 2'000'000'000
  14. #define Num_of_Digits(n) ((int)log10(n)+1)
  15. #define fixed(n) fixed << setprecision(n)
  16. #define imin INT_MIN
  17. #define imax INT_MAX
  18. #define Time cerr << "Time Taken: " << (float)clock() / CLOCKS_PER_SEC << " Secs" << "\n" ;
  19.  
  20. void ABDEL3AL () {
  21. ios_base::sync_with_stdio(false); cin.tie(nullptr) , cout.tie(nullptr) ;
  22. #ifndef ONLINE_JUDGE
  23. freopen("input.txt" , "r" , stdin) , freopen("output.txt" , "w" , stdout) ;
  24. #endif
  25. Time
  26. }
  27.  
  28.  
  29. int main() {
  30. ABDEL3AL() ;
  31. int t , k ;
  32. cin >> t >> k ;
  33. if ((t + k) % 24 == 0) cout << 24 << "\n" ;
  34. else if ((t + k) % 24 < 0) cout << (t + k) % 24 + 12 ;
  35. else cout << (t + k) % 24 ;
  36. return 0;
  37. }
  38.  
  39.  
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement