Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <string>
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- using namespace std;
- int main() {
- int divisor{}, play{}, number{}, guess{};
- cout << "I've picked a number between 1 and 50 that has " << divisor << " divisor(s). ";
- divisor = rand() % 50 + 1;
- cout << "\n Guess the number: ";
- cin >> guess;
- srand(time(NULL));
- guess = rand() % 50 + 1;
- if (guess < number)
- {
- cout << "\nToo low!" << endl; // so close! :c
- }
- else if (guess > number)
- {
- cout << "\nToo high!" << endl; //oh no :c
- }
- else if (guess = number)
- {
- cout << "\n You got it!! " << endl; // UwU OwO im so pwoud!
- } while (guess != number);
- cout << " Play again? [y/n] " << endl;
- cin >> play;
- if (play == 'y')
- {
- }
- else if (play == 'n')
- {
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement