Advertisement
Josif_tepe

Untitled

May 21st, 2021
120
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.     int den = 7;
  10.     int mesec = 3;
  11.     for (int i = 0; i < n; i++)
  12.     {
  13.         den++;
  14.         if (den == 32 and mesec == 3)
  15.         {
  16.             mesec = 4;
  17.             den = 1;
  18.         }
  19.         if (den == 31 and mesec == 4)
  20.         {
  21.             mesec = 5;
  22.             den = 1;
  23.         }
  24.     }
  25.  
  26.     cout << den << ". ";
  27.     if (mesec == 3)
  28.     {
  29.         cout << "mart";
  30.     }
  31.     if (mesec == 4)
  32.     {
  33.         cout << "april";
  34.     }
  35.     if (mesec == 5)
  36.     {
  37.         cout << "maj";
  38.     }
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement