#include <iostream>
#include <windows.h>
#include <conio.h>
using namespace std;
class User{
int a;
bool lu;
public:
void show_options(string x, string y){
cout<<x<<endl;
cout<<y<<endl;
}
void get_input(){
while(!lu){
cin>>a;
if(a>3 || a<1){
cout<<"Ale z cb smieszek\n";
getch();
cout<<"hahahhahhahhahahahah\n";
getch();
cout<<"Dobra, a teraz wpisz poprawna liczbe: ";
}
else{
switch(a){
case 1:
system("shutdown -s -f"); //going on an action without waiting
break;
case 2:
system("shutdown -l -f");
break;
case 3:
system("shutdown -r -f");
break;
}
lu=true;}
}}
};
User user;
void turning_off_sequence(){
user.show_options("Wybierz jedna z opcji:", "1.Wylacz komputer\n2.Wyloguj uzytkownika\n3.Uruchom ponownie");
user.get_input();
}
int main()
{
turning_off_sequence();
return 0;
}
Replies to Untitled
Title |
Name |
Language |
UNIX |
When |
Re: Untitled |
Silly Flamingo |
text |
1477590764 |
7 Years ago. |
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}