Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int liczba;
- cin >> liczba; // pobranie wartości zmiennej liczba z klawiatury
- switch(liczba)
- {
- case 1:
- cout << "Wpisales liczbe 1\n";
- break;
- case 2:
- cout << "Wpisales liczbe 2\n";
- break;
- case 3:
- cout << "Wpisales liczbe 3\n";
- break;
- default: // jeżeli wartość nie pojawi się wcześniej
- cout << "Wpisana liczba ma inna wartosc niz 1, 2 lub 3\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement