Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <cstdlib>
- #include <iostream>
- #include <ctime>
- #include <string>
- using namespace std;
- int main(void) {
- setlocale(LC_ALL, "");
- int epsilon, los, liczba;
- cout << "Podaj liczbę:" << endl;
- cin >> liczba;
- cout << "Podaj epsilon" << endl;
- cin >> epsilon;
- srand(time(NULL));
- los = rand();
- if ((los + epsilon) < liczba) cout << "liczba za duża";
- else if ((los - epsilon) > liczba) cout << "liczba za mała";
- else cout << "trafiłeś, to jest ta liczba w granicach błędu";
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement