Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <time.h>
- using namespace std;
- int liczba; int gra;
- int main()
- {
- cout << "Gra o zgadywaniu liczb od 100..0!" << endl;
- srand(time(NULL));
- liczba = rand()% 100+1;
- while (gra!=liczba)
- {
- cout<<"podaj liczbe"<<endl;
- cin>>gra;
- if(gra==liczba)
- {
- cout<<"wygrales gre"<<endl;
- }
- if(gra>liczba)
- {
- cout<<"to za duza"<<endl;
- }
- else if(gra<liczba)
- {
- cout<<"to za malo"<<endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement