Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #include <iostream>
- #include <cstdlib>
- #include <time.h>
- using namespace std;
- int main()
- {
- int liczba, strzal;
- cout<<"Pomyslalem sobie liczbe"<<endl;
- srand(time(NULL));
- liczba=rand()%100+1;
- while(strzal!=liczba)
- {
- cout<<"Zgadnij jaka?: "<<endl;
- cin>>strzal;
- if (strzal==liczba)
- {
- cout<<"Wygrales"<<endl;
- }
- else if (strzal<liczba)
- {
- cout<<"To za malo"<<endl;
- }
- else if (strzal>liczba)
- {
- cout<<"To za duzo"<<endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement