switch++
This commit is contained in:
parent
98153ae731
commit
9135be06d5
1 changed files with 33 additions and 0 deletions
33
4-Warunki/switch/2/main.cpp
Normal file
33
4-Warunki/switch/2/main.cpp
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
Program przyjmuje numer dnia tygodnia 1-7 i wypisuje czy to dzien roboczy 1-5 czy weekend 6-7
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int dzien;
|
||||||
|
|
||||||
|
cout << "Podaj dzien: ";
|
||||||
|
cin >> dzien;
|
||||||
|
|
||||||
|
switch (dzien) {
|
||||||
|
case 1:
|
||||||
|
case 2:
|
||||||
|
case 3:
|
||||||
|
case 4:
|
||||||
|
case 5:
|
||||||
|
cout << "Dzien roboczy";
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
case 7:
|
||||||
|
cout << "Weekend";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
cout << "ERR";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue