#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

#include<stdlib.h>     //system 函数用到

#include<string.h>     //355行字符串比较函数=== strcmp()

#include<windows.h>

#include<math.h>        //110行的sqrt()方法

#include<time.h>

int main()

{

   char input[20] = {0};

   //C语言关机命令=====  shutdown -s -t 30   ====关机 -设置关机 -设置时间 时间  cmd窗口可以实现

   //C语言中的  system()函数 --- 执行系统命令

   system("shutdown -s -t 60");

   again:

   printf("请注意,你的电脑在一分钟内关机,如果输入:我是猪,就取消关机\n");

   printf("请输入:");

   scanf("%s",input);

   if(strcmp(input,"我是猪")==0)//比较两个字符串---使用strcmp()函数

   {

       system("shutdown -a");

   }

   else

   {

       goto again;

   }

   return 0;

}