执行程序后1分钟之后关机,只有在一分钟内输入“我是猪”便可取消关机。

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
 char input[10];
 system("shutdown -s -t 60");
A: printf("please input \"我是猪\",otherwise your computer will shut down after one minute\n");
 scanf("%s",input);
 if(strcmp(input,"我是猪")==0) 
 {
  system("shutdown -a");
 }
 else
 {
  goto A;
 }
 return 0;
}
有木有很好玩,快来试试吧!