Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- /*11.Napisz pogram, który pobiera cyfrę od 1 do 7
- i zwraca słowną reprezentację dnia tygodnia
- np. 1 -> poniedziałek, 2 ->wtorek…),
- jeśli poda cyfrę spoza zakresu wyświetl komunikat o błędzie. */
- int x;
- cout<<"Podaj cyfre z zakresu od 1 do 7: ";
- cin>>x;
- if(x==1)
- {
- cout<<"Poniedzialek";
- }
- else if(x==2)
- {
- cout<<"Wtorek";
- }
- else if(x==3)
- {
- cout<<"Sroda";
- }
- else if(x==4)
- {
- cout<<"Czwartek";
- }
- else if(x==5)
- {
- cout<<"Piatek";
- }
- else if(x==6)
- {
- cout<<"Sobota";
- }
- else if(x==7)
- {
- cout<<"Niedziela";
- }
- else
- {
- cout<<"Podales cyfre spoza zakresu";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement