Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void petlaFor(int c){
- cout << "Petla For, czas:"<<c<<"\n";
- }
- void petlaWhile(int c){
- cout << "Petla While, czas:"<<c<<"\n";
- }
- void petlaDoWhile(int c){
- cout << "Petla DoWhile, czas:"<<c<<"\n";
- }
- int main(){
- cout << "Czeœæ, jestem tutaj, aby wyœwietliæ tobie Randomow¹ osobê z tablicy.\n";
- cout << "[1] For\n";
- cout << "[2] While\n";
- cout << "[3] Do.. While\n";
- int wybor;
- while(true){
- cin >> wybor;
- if(wybor<1||wybor>3)
- cout << "Niepoprawny wybor !\n";
- else break;
- }
- cout << "Wybor poprawny.. Teraz podaj czas\n";
- int czas;
- cin << czas;
- if(czas!=0){
- cin<<czas;
- }
- switch(wybor){
- case 1:
- petlaFor(czas);
- break;
- case 2:
- petlaWhile(czas);
- break;
- case 3:
- petlaDoWhile(czas);
- break;
- default:
- main();
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment