Advertisement
nRikee

Apagar PC v.1.0

Dec 8th, 2011
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.09 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int s;
  7.  
  8.     do{
  9.         system("cls");
  10.         printf("Apagar PC 1.0\nAutor: @nRikee93\n\nElige:\n1.Apagar\n2.Cancelar apagado.\n_");
  11.         scanf("%d",&s);
  12.     } while (s==1&&s==2);
  13.  
  14.     if(s==1){
  15.  
  16.         do{
  17.             system("cls");
  18.             printf("Apagar PC 1.0\nAutor: @nRikee93\n\nElige el retardo:\n1.Un minuto\n2.Diez minutos\n3.Media hora\n4.Una hora\n5.Dos horas\n6.Cinco horas\n\n_");
  19.             scanf("%d",&s);
  20.         } while(s<1||s>6);
  21.  
  22.         switch(s)
  23.         {
  24.             case 1: system("shutdown /s /t 60");
  25.                     break;
  26.             case 2: system("shutdown /s /t 600");
  27.                     break;
  28.             case 3: system("shutdown /s /t 1800");
  29.                     break;
  30.             case 4: system("shutdown /s /t 3600");
  31.                     break;
  32.             case 5: system("shutdown /s /t 7200");
  33.                     break;
  34.             case 6: system("shutdown /s /t 18000");
  35.                     break;
  36.         }
  37.     }
  38.     if(s==2){
  39.         system("shutdown /a");
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement