Facebook
From Mungo Pheasant, 5 Years ago, written in C++.
Embed
Download Paste or View Raw
Hits: 233
  1. #include "pch.h"
  2. #include <iostream>
  3. #include <ctime>
  4. #include <windows.h>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.         cout << "Witaj! Dzisiaj sprawdzimy jak dobry jestes z tabliczki mnozenia!" << endl;
  11.         int lvl = 5;
  12.         int state = 1;
  13.         int stat = 0;
  14.         int odp = 0;
  15.  
  16.         int x, y;
  17.         srand(time(NULL));
  18.         bool prawda = false;
  19.  
  20.         while (!prawda)
  21.         {
  22.                 cout << "Poziom: " << state << endl;
  23.  
  24.                 x = rand() % lvl;
  25.                 y = rand() % lvl;
  26.  
  27.                 cout << "ile to jest " << x+stat << " x " << y << "?" << endl;
  28.                 cout << "Odpowiedz: ";
  29.                 cin >> odp;
  30.  
  31.                 if (odp == (x+stat) * y)
  32.                 {
  33.                         cout << endl << "Brawo!!!" << endl;
  34.                         state++;
  35.                         stat++;
  36.                         lvl++;
  37.                         system("cls");
  38.                 }
  39.                 else prawda = true;
  40.         }
  41. }