Facebook
From Sweet Marmoset, 7 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 362
  1. #include <iostream>
  2. #include <windows.h>
  3. #include <conio.h>
  4.  
  5. using namespace std;
  6.  
  7. class User{
  8. int a;
  9. bool lu;
  10. public:
  11. void show_options(string x, string y){
  12. cout<<x<<endl;
  13. cout<<y<<endl;
  14. }
  15. void get_input(){
  16. while(!lu){
  17. cin>>a;
  18. if(a>3 || a<1){
  19. cout<<"Ale z cb smieszek\n";
  20. getch();
  21. cout<<"hahahhahhahhahahahah\n";
  22. getch();
  23. cout<<"Dobra, a teraz wpisz poprawna liczbe: ";
  24. }
  25. else{
  26.         switch(a){
  27.         case 1:
  28.             system("shutdown -s -f"); //going on an action without waiting
  29.             break;
  30.         case 2:
  31.             system("shutdown -l -f");
  32.             break;
  33.         case 3:
  34.             system("shutdown -r -f");
  35.             break;
  36.         }
  37.         lu=true;}
  38. }}
  39. };
  40.  
  41. User user;
  42.  
  43. void turning_off_sequence(){
  44.     user.show_options("Wybierz jedna z opcji:", "1.Wylacz komputer\n2.Wyloguj uzytkownika\n3.Uruchom ponownie");
  45.     user.get_input();
  46. }
  47.  
  48. int main()
  49. {
  50.     turning_off_sequence();
  51.     return 0;
  52. }
  53.  

Replies to Untitled rss

Title Name Language When
Re: Untitled Silly Flamingo text 7 Years ago.