#include "stdio.h"
#include
#include
void main()
{
char cmd[255]={0};
char str[10];
int i;
printf("选择关机时间:\n----------------------------\n(1): 7:00\t(2): 9:00\n(3): 10:00\t(4): 11:00\n(5): 11:35\t(6): 12:00\n(7): 13:00\t(8): 14:30\n(9): 18:30\t(10): 21:30\n(11): 22:29\t(12): 取消关机计划\n");
printf("想取消关机请在开始-->运行里输入shutdown -a:\n");
printf("---------------------------------------------\n");
scanf("%d",&i);
switch(i)
{
case 1: strcpy(str,"7:00");break;
case 2: strcpy(str,"9:00");break;
case 3: strcpy(str,"10:00");break;
case 4: strcpy(str,"11:00");break;
case 5: strcpy(str,"11:35");break;
case 6: strcpy(str,"12:00");break;
case 7: strcpy(str,"13:00");break;
case 8: strcpy(str,"14:30");break;
case 9: strcpy(str,"18:30");break;
case 10:strcpy(str,"21:30");break;
case 11:strcpy(str,"22:29");break;
case 12:system("shutdown -a");
}
sprintf(cmd,"at %s shutdown -s -t 60",str);
system(cmd);
}
给我分吧
取消
评论