Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using namespace std;
- void generate(int *a, int *b, int *c) {
- srand(time(NULL));
- *a = rand() % 10;
- *b = rand() % 10;
- *c = *a * *b;
- }
- int main() {
- setlocale(LC_ALL, "rus");
- double answer = 0;
- int score = 0;
- int a = 0;
- int b = 0;
- int c = 0;
- for (int i = 0; i < 10; i++) {
- generate(&a, &b, &c);
- cout <<a<<"*"<<b<<"=ΡΠ΅ΠΌΡ?"<< endl;
- cin >> answer;
- if (answer == c) {
- score++;
- }
- else {
- }
- answer = 0;
- }
- if (score == 10 || score == 9) {
- cout << "Noice" << endl;
- cout << score << endl;
- }
- else if (score == 8 || score == 7) {
- cout << "Not bad" << endl;
- cout << score << endl;
- }
- else if (score <= 6) {
- cout << "NOT GOOD ENOUGHT" << endl;
- cout << score << endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment