Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <time.h>
- using namespace std;
- int main()
- {
- int liczba,strzal=0;
- srand(time(NULL));
- liczba = rand() % 10 + 1;
- while (strzal != liczba) {
- int strzal=0;
- cout << "Podaj liczbe z przedzialu od 1-10" << endl;
- cin >> strzal;
- if (strzal == liczba) {
- cout << "Zgadles" << endl;
- break;
- }
- if (strzal < liczba) {
- cout << "Wylosowana liczba jest wieksza" << endl;
- }
- else {
- cout << "Wylosowana liczba jest mniejsza" << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment