Advertisement
rikardoricz

11 IF Tomasz Świątek 3BTI/2

Nov 17th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int dzien;
  8.     cout << "Podaj cyfre od 1 do 7 okreslajaca dzien tygodnia: " << endl;
  9.     cin >> dzien;
  10.  
  11.     if (dzien>0&&dzien<8)
  12.     {
  13.         if (dzien==1)
  14.         {
  15.             cout << "poniedzialek";
  16.         }
  17.         else if (dzien==2)
  18.         {
  19.             cout << "wtorek";
  20.         }
  21.         else if (dzien==3)
  22.         {
  23.             cout << "sroda";
  24.         }
  25.         else if (dzien==4)
  26.         {
  27.             cout << "czwartek";
  28.         }
  29.         else if (dzien==5)
  30.         {
  31.             cout << "piatek";
  32.         }
  33.         else if (dzien==6)
  34.         {
  35.             cout << "sobota";
  36.         }
  37.         else if (dzien==7)
  38.         {
  39.             cout << "niedziela";
  40.         }
  41.     }
  42.     else
  43.     {
  44.         cout << "Blad! Nie podano cyfry z zakresu 1-7 oznaczajacej numer dnia tygodnia.";
  45.     }
  46.     return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement