Академический Документы
Профессиональный Документы
Культура Документы
-----------
Д З В Ы П О Л Н И Л
Б А Б У Р О В И В А Н
-----------------------------------------------------------------------------------
-----------
-----------------------------------------------------------------------------------
-----------
З А Д А Н И Е 1
-----------------------------------------------------------------------------------
-----------
-----------------------------------------------------------------------------------
-----------
З А Д А Н И Е 2
-----------------------------------------------------------------------------------
-----------
-----------------------------------------------------------------------------------
-----------
З А Д А Н И Е 3
struct game
{
int q[4];
int a[4];
void init()
{
for (int i = 0; i < 4; ++i)
{
q[i] = rand() % 10;
}
}
void proceed(int n)
{
++n;
int num;
if (check(num))
{
std::cout << "\n******\n\nOK, attempts = " << n;
char x;
do
{
std::cout << "\n\nAnother run? (y/n) ";
std::cin >> x;
} while (x != 'y' && x != 'n');
if (x == 'y') run();
}
else {
proceed(n);
}
}
int b = 0;
int c = 0;
bool c_check[4] = { false };
if (b == 4) return true;
std::cout << "\n b = " << b << " c = " << c << "\
n------------------------";
return false;
}
void run()
{
init();
proceed(0);
}
};
int main()
{
srand(time(0));
game A;
A.run();
system("pause");
return 0;
}
-----------------------------------------------------------------------------------
-----------