Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- //#include "factorial.h"
- #include <ctime>
- #include <Windows.h>
- using namespace std;
- const int NotUsed = system("color 0");
- int Foo(int N)
- {
- if (N == 0)
- return 0;
- if (N == 1)
- return 1;
- return N * Foo(N - 1);
- }
- void sel(int select)
- {
- switch (select)
- {
- case 1:
- cout << "Нет." << endl;
- system("pause");
- break;
- case 2:
- {
- int N;
- cout << "Число факториала: " << endl;
- cin >> N;
- cout << "Фактариал числа: " << N << "равен = " << Foo(N) << endl;
- break;
- }
- case 3:
- {
- {
- while (true) {
- srand(time(NULL));
- int pass;
- const int NotUsed = system("color 0");
- cout << "Приветствую тебя, Админ, напиши пароль, псс, пароль — 1 :)" << endl;
- cin >> pass;
- if (pass == 1)
- {
- cout << "Успешно)" << endl
- << "Что делаем?:" << endl
- << "1. Играем в кости, конечно же)" << endl;
- int brosok;
- cout << "Играем в кости" << endl;
- {
- int a = rand() % 6 + 1;
- int b = rand() % 6 + 1;
- cout << "Я бросила 1 кость: " << a << " )))) " << endl;
- cout << "Теперь твой ход, введи 1 для броска)" << endl;
- cin >> brosok;
- if (brosok == 1)
- {
- cout << "Ты бросил кость: " << b << endl;
- if (a > b)
- cout << "Победила программа" << endl;
- if (a < b)
- {
- cout << "Победил Админ" << endl;
- }
- cout << "Для выход напиши - leave" << endl;
- string exit;
- cin >> exit;
- if (exit == "leave")
- return;
- if (a == b)
- cout << "ничья" << endl;
- }
- }
- }
- else
- {
- cout << "error" << endl;
- }
- }
- }
- }
- }
- }
- bool login100500TopSecret()
- {
- int password;
- int login;
- cout << "Password?: " << endl;
- cin >> password;
- if (password != 1)
- return false;
- cout << "Login?:" << endl;
- cin >> login;
- if (login != 1); // ливардас что ета ааааа
- return true;
- }
- string menu4(char cyc)
- {
- if(cyc == 'Y') return "Выйти";
- else return "Зациклить программу.";
- }
- int main()
- {
- setlocale(LC_ALL, "ru");
- if(!login100500TopSecret())
- return 0;
- char cyc = 'N';
- int select = 0;
- do{
- cout << "Привет, что хочешь сделать?" << endl
- << "1. 1" << endl
- << "2. 2." << endl
- << "3. 3" << endl
- << "4." << menu4(cyc) << endl; // v processe
- cin >> select;
- if(select == 4 && cyc == 'N') cyc = 'Y';
- else if(select == 4 && cyc == 'Y') cyc = 'N';
- else sel(select);
- cout << select << " " << cyc << endl;
- }while(cyc == 'Y');
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement