#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char input = { 0 };
system("shutdown -s -t 120");
f:
printf("电脑还有2分钟关机,输入爸爸取消关机:");
scanf("%s\n", input);
if (strcmp(input, "爸爸") == 0)
{
system("shutdown -a");
printf("取消关机成功");
}
else
{
goto f;
}
return 0;
}
定时关机的那条命令能执行吗?不能,把横线-换成/试试