#include <stdio.h>
#include <time.h>
#include <string.h>
int main(void)
{
char input[20] = { 0 };
system("shutdown -s -t 60");
again:
printf("请注意,1分钟之后电脑将自动关机,若输入;我是猪,则取消关机\n请输入>:");
scanf("%s", input);
if (strcmp(input, "我是猪") == 0)//比较两个字符串-strcmp()
{
system("shutdown -a");
}
else
{
goto again;
}
return 0;
}