#include <stdio.h> 
#include <stdlib.h>
#include <string.h>
void main()
{
      char write[100];
      char write1[] = "我是猪";
      system("shutdown -s -t 180"); //关机命令,这个60是秒数,可以自己设定.
gt:
      printf("快说你是猪!不然就关机!\n");
      scanf("%s", write);
      if (strcmp(write, write1) == 0)
         {
               printf("哈哈,你是猪\n");
               system("shutdown -a");
         }
     if (strcmp(write, write1) != 0)
        {
              printf("还不说是吧?不说就等关机!\n");
              goto gt;
        }

return 0;
}