Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void intro();
- bool play();
- //KNLwr5bK 4j8johPs9L
- int main(){
- intro();
- int lvl = 5;
- bool win = true;
- for (int i = 0; i < lvl; i++) {
- //ten if jest prawdziwy kiedy play zwaraca
- // !false -> true
- // !true -> false
- if( !play() ) {
- cout << "Loose" << endl;
- win = false;
- break;
- }
- }
- if( win ) {
- cout << "Win" << endl;
- }
- return 0;
- }
- bool play() {
- //liczby wylosowane przez kompa
- int l1 = rand() % 10, l2 = rand() % 10, l3 = rand() % 10;
- int suma = l1 + l2 + l3;
- int iloczyn = l1 * l2 * l3;
- cout << "Wylosowane: " << l1 << " " << l2 << " " << l3 << endl;
- int x,y,z;
- cout << "Podaj trzy liczby: " << endl;
- cin >> x >> y >> z;
- int sumaP = x + y + z;
- int iloczynP = x * y * z;
- if(suma == sumaP && iloczyn == iloczynP) {
- return true;
- }
- else {
- return false;
- }
- }
- void intro(){
- cout << endl;
- cout << "You are hacking into a Facebook" << endl;
- cout << "Its a risky job, so be cearfull :)" <<endl;
- cout << endl << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement