siema ziomy zrobilem program co wam sprawdzi dydka joł
#include <iostream>
using namespace std;
bool dlugi(int x){
if(x>16) return true;
else return false;
}
bool sredni(int x){
if(x=16) return true;
else return false;
}
bool krotki(int x){
if(x<16) return true;
else return false;
}
int main(){
int w=0,x,y,z=0;
do{
cout<<"Wprowadz dlugosc dydka:"<<endl;
cin>>x;
if(dlugi(x) == true) cout<<"Dydek jest wielki"<<endl;
else{
if(krotki(x) == true) cout<<"Dydek jest krotki"<<endl;
else{
if(sredni(x) == true) {cout<<"Dydek jest sredni"<<endl;}
else cout<<"Błąd programu."<<endl;
}
}
do{
w = 0;
z = 0;
cout<<"Czy chcesz sprawdzic jeszcze jeden dydek?\n"<<
"[1] Nie\n"<<"[2] Tak: ";
cin>>y;
switch(y)
{ case 2:
w++;
break;
case 1:
cout<<"Do widzenia!\n";
z++;
w++;
break;
default:
cout<<"Sprobuj jeszcze raz. Nie rozpoznalem komendy."<<endl;
break;
}
}while(w != 1);
}while(z != 1);
system("Pause");
return 0;
}