Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <windows.h>
  2. #include <iostream>
  3. #include <cstdlib>
  4. #include <time.h>
  5.  
  6. using namespace std;
  7. int main()
  8. {
  9. int liczba, strzal;
  10. cout<<"Pomyslalem sobie liczbe"<<endl;
  11. srand(time(NULL));
  12. liczba=rand()%100+1;
  13.  
  14. while(strzal!=liczba)
  15. {
  16. cout<<"Zgadnij jaka?: "<<endl;
  17. cin>>strzal;
  18. if (strzal==liczba)
  19. {
  20. cout<<"Wygrales"<<endl;
  21. }
  22. else if (strzal<liczba)
  23. {
  24. cout<<"To za malo"<<endl;
  25. }
  26. else if (strzal>liczba)
  27. {
  28. cout<<"To za duzo"<<endl;
  29. }
  30. }
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement