goto:可以任意跳转到需要执行的行
char input[20] = {0};
system("shutdown -s -t 60");
again:
printf("请注意你的电脑将在一分钟之内关机,如果输入:我是猪,就取消关机!\n请输入:");
scanf("%s",&input);
if(strcmp(input,"我是猪") == 0)
{ //比较两个字符串
system("shutdown -a");
}
else
goto again;
goto:可以任意跳转到需要执行的行
char input[20] = {0};
system("shutdown -s -t 60");
again:
printf("请注意你的电脑将在一分钟之内关机,如果输入:我是猪,就取消关机!\n请输入:");
scanf("%s",&input);
if(strcmp(input,"我是猪") == 0)
{ //比较两个字符串
system("shutdown -a");
}
else
goto again;