#include <stdio.h>
#include <stdlib.h>
int main()
{
char cmd[30];
int tis;//时间单位为秒
printf("plz input a time in seconds: \n");
scanf("%d", &tis);
sprintf(cmd, "shutdown -r -t %d", tis);
printf("%s", cmd);
system(cmd);//请打开cmd窗口输入命令 shutdown -a 取消操作
return 0;
}