Advertisement
MeehoweCK

Untitled

Nov 30th, 2020
737
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int liczba;
  8.     cin >> liczba;      // pobranie wartości zmiennej liczba z klawiatury
  9.  
  10.     switch(liczba)
  11.     {
  12.     case 1:
  13.         cout << "Wpisales liczbe 1\n";
  14.         break;
  15.     case 2:
  16.         cout << "Wpisales liczbe 2\n";
  17.         break;
  18.     case 3:
  19.         cout << "Wpisales liczbe 3\n";
  20.         break;
  21.     default:    // jeżeli wartość nie pojawi się wcześniej
  22.         cout << "Wpisana liczba ma inna wartosc niz 1, 2 lub 3\n";
  23.     }
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement