Gdy klikam 0 działa poprawnie a gdy 1 to nie wyswietla sie nic.
#include <iostream>
#include <cstdlib>
#include <conio.h>
using namespace std;
float metry;
float ile_cali( float m)
{
return m*39.27;
}
void graliczb()
{
{
cout<<"Witaj! Pomyslalem sobie liczbe 1..100"<<endl;
srand(time(NULL));
liczba = rand()%100+1;
while(strzal!=liczba)
{
ile_prob++;
cout<<"Zgadnij jaka (to Twoja "<<ile_prob<<" proba): ";
cin>>strzal;
if(strzal==liczba)
cout<<"Udalo sie! Wygrywasz w "<<ile_prob<<" probie"<<endl;
else if(strzal<liczba)
cout<<"To za malo"<<endl;
else if(strzal>liczba)
cout<<"To za duzo"<<endl;
}
getchar();getchar(); //dla pewnosci 2 razy
}
}
float ile_jardy( float j);
float ile_km( float km);
float ile_decymetrow( float dec);
float ile_centymetrow( float cen);
float ile_milimetrow( float mil);
float ile_mikrometrow( float mik);
float ile_angstrem( float an);
float ile_stop ( float st)
{
return st*3.281;
}
void ile_milmorskich( float ms)
{
cout<<"tyle mil morskich"<<ms*0.00054<<endl;
}
void ile_au( float ja)//potem
{
cout<<"tyle jenostek astronomicznych au"<<ja*0.0000000000066845871222684;
}
float ile_parsekow( float pa)
{
return pa*0.000000000000000032407790389471;
}
float ile_latswietlnych( float ls)
{
return ls*0.00000000000000010570008340246;
}
void ile_mil( float m)
{
cout<<"na mile :"<<m*0.0006213<<endl;
}
int wybor;
int main()
{
cout<<"0 Zamiana jednostek"<<endl;
cout<<"1 Gra liczbowa"<<endl;
cout<<"witaj w moim programie wybierz opcje i zatwierdzenterem : ";
cin>> wybor;
switch(wybor)
{
case 0:
cout << "Podaj ile metrow!" ;
cin >>metry;
cout<<"tyle cali :"<<ile_cali(metry)<<endl;
ile_mil(metry);
ile_milmorskich(metry);
cout<<"tyle jardow "<< ile_jardy(metry)<<endl;
cout<<"tyle kilometrow : "<< ile_km(metry)<<endl;
cout<<"tyle decymetrow : "<< ile_decymetrow(metry)<<endl;
cout<<"tyle centymetrow : "<< ile_centymetrow(metry)<<endl;
cout<<"tyle milmetrow :"<< ile_milimetrow(metry)<<endl;
cout<<"tyle mikrometrow:"<<ile_mikrometrow(metry)<<endl;
cout<<"tyle angstrem :"<<ile_angstrem(metry)<<endl;
cout<<"tyle stop : "<<ile_stop(metry)<<endl;
cout<<"tyle parsekow : "<<ile_parsekow(metry)<<endl;
cout<<"tyle lat swietlnych;"<<ile_latswietlnych(metry)<<endl;
ile_au( metry);
break;
case 1:
cout<<"jajko";
graliczb()
break;
}
getch();
return 0;
}
float ile_jardy( float j)
{
return j*1.0936133;
}
float ile_km( float km)
{
return km*0.0010000000;
}
float ile_decymetrow( float dec)
{
return dec*10.000;
}
float ile_centymetrow( float cen)
{
return cen*100.000;
}
float ile_milimetrow( float mil)
{
return mil*1000.000;
}
float ile_mikrometrow( float mik)
{
return mik*1000000.000;
}
float ile_angstrem( float an)
{
return an*10000000000.000;
}