Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- #include <conio.h>
- #include <cmath>
- int main();
- int potegowanie();
- std::string login, password;
- int adminpanel()
- {
- printf("====[ADMIN_PANEL]====\n");
- printf("testy");
- }
- int dashboard()
- {
- int choice;
- if (login == "root")
- {
- printf("\nMenu:\n1.) Potegowanie\n2.) Wyjdz\n3.) Panel Administrator\n");
- }
- else
- {
- printf("\nMenu:\n1.) Potegowanie\n2.) Wyjdz\n");
- }
- std::cin >> choice;
- switch(choice)
- {
- case 1:
- potegowanie(); break;
- case 2:
- printf("See you soon! ;)"); break;
- if(login == "root")
- {
- case 3:
- adminpanel(); break;
- }
- }
- return 0;
- }
- double wynik;
- int poteguj(int pLiczba, int pPotega)
- {
- wynik = pow(pLiczba, pPotega);
- return 0;
- }
- int potegowanie()
- {
- int liczba, potega, choice;
- printf("Wporwadz liczbe ktora chesz potegowac:\n");
- std::cin >> liczba;
- printf("Wprowadz potege:\n");
- std::cin >> potega;
- poteguj(liczba, potega);
- std::cout << "Wynik: " << wynik << std::endl;
- printf("\nCo checesz teraz zrobic?\n1.) Wróc do menu\n2.) Kolejne potegowanie\n");
- std::cin >> choice;
- switch(choice)
- {
- case 1:
- dashboard(); break;
- case 2:
- potegowanie(); break;
- }
- return 0;
- }
- int main()
- {
- std::string reglogin, regpassword;
- std::string root = "root";
- std::string hasloroot = "root";
- std::string choicefirst;
- printf("Witaj! Musisz sie zalogowac lub zarejestrowac.(logowanie, rejestracja)\n");
- std::cin >> choicefirst;
- if (choicefirst == "logowanie")
- {
- printf("Login: \n");
- std::cin >> login;
- printf("\nHaslo:\n");
- std::cin >> password;
- if (login == reglogin)
- {
- if (password == regpassword)
- {
- dashboard();
- }
- }
- if (login == root)
- {
- if (password == hasloroot)
- {
- printf("Witaj ADMINISTRATORZE w programie!");
- dashboard();
- }
- }
- else
- {
- printf("Cos sie nie zgadza! Zresetuj program i sproboj jeszcze raz\n");
- }
- return 0;
- }
- if (choicefirst == "rejestracja")
- {
- printf("Wprowadz login:\n");
- std::cin >> reglogin;
- printf("Wprowadz haslo:\n");
- std::cin >> regpassword;
- printf("\nCzas na twoje pierwsze logowanie!\nLogin:\n");
- std::cin >> login;
- printf("Haslo:\n");
- std::cin >> password;
- if (login == reglogin)
- {
- if (password == regpassword)
- {
- dashboard();
- }
- }
- else
- {
- printf("Cos pomyliles! Zresetuj program");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement