Advertisement
Josif_tepe

Untitled

Feb 9th, 2021
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n;
  8.     cin >> n;
  9.     int momentalen_den = 7;
  10.     int mesec = 3;
  11.     for(int i = 1; i <= n; i++) {
  12.         momentalen_den++;
  13.         if(momentalen_den == 32 && mesec == 3) {
  14.             mesec++;
  15.             momentalen_den = 1;
  16.         }
  17.         if(momentalen_den == 31 && mesec == 4) {
  18.             mesec++;
  19.             momentalen_den = 1;
  20.         }
  21.     }
  22.     cout << momentalen_den << ". ";
  23.     if(mesec == 3) {
  24.         cout << "mart" << endl;
  25.     }
  26.     else if(mesec == 4) {
  27.         cout << "april" << endl;
  28.     }
  29.     else {
  30.         cout << "maj" << endl;
  31.     }
  32.     return 0;
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement