Advertisement
Josif_tepe

Untitled

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