ciao,
io in questo esercizio propongo di creare un programma che:
- spenga il pc(linux o windows o os)
- Abbia 2 timer (60 ,30 secondi)
- che sia un timer interno al programma e quindi no:
Esempio con win:
-e riavii il pc sempre con o senza timer
ecco il mio C Code
[attenzione è linkato con dev-cpp quindi non ditemi che mancano inclusioni]
[ot]
VERSIONE WINDOWS
[/ot]
io in questo esercizio propongo di creare un programma che:
- spenga il pc(linux o windows o os)
- Abbia 2 timer (60 ,30 secondi)
- che sia un timer interno al programma e quindi no:
Esempio con win:
Codice:
shutdown -s -t 60
ecco il mio C Code
[attenzione è linkato con dev-cpp quindi non ditemi che mancano inclusioni]
[ot]
VERSIONE WINDOWS
Codice:
#include <stdio.h>
main(char **argv[]){
int n=0;
int t=0;
system("title Shutdown By Kr1pn0$");
system("color f0");
printf("Decidi cosa fare:\n"
"\t\t1-Spegni il computer con timer di 1 un minuto\n"
"\t\t2-riavvia il computer con timer di 1 un minuto\n"
"\t\t3-Spegni il computer con timer di 30 secondi\n"
"\t\t4-riavvia il computer con timer di 30 secondi\n"
"\t\t5-Spegni il computer\n"
"\t\t6-riavvia\n"
"\n\n\n\t\t\t\t\tDesigned by kr1pn0$\n");
scanf("%d",&n);
if(n>6 || n<1){
printf("\n\n\nNon hai digitato un numero valido");
return 1;
}
if(n==1){
system("cls");
for(t=60;t>=0;t--){
printf("TIMER AVVIATO\n\n");
printf("Mancano %d secondi...",t);
sleep(1000);
system("cls");
}
system("shutdown -s");
}
if(n==2){
system("cls");
for(t=60;t>=0;t--){
printf("TIMER AVVIATO\n\n");
printf("Mancano %d secondi...",t);
sleep(1000);
system("cls");
}
system("shutdown -r");
}
if(n==3){
system("cls");
for(t=30;t>=0;t--){
printf("TIMER AVVIATO\n\n");
printf("Mancano %d secondi...",t);
sleep(1000);
system("cls");
}
system("shutdown -r");
}
if(n==4){
system("cls");
for(t=30;t>=0;t--){
printf("TIMER AVVIATO\n\n");
printf("Mancano %d secondi...",t);
sleep(1000);
system("cls");
}
system("shutdown -r");
}
if(n==5){
system("shutdown -s");
}
if(n==6){
system("shutdown -r");
}
}