首页 > 编程语言 >关机程序

关机程序

时间:2022-11-05 23:00:15浏览次数:40  
标签:关机 again 程序 system shutdown input include

关机程序_#shutdown

附上代码:

#include<stdio.h>

#include<stdlib.h>

#include<string.h>

int main()

{

char input[20] = {0};

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

again:

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

 scanf("%s",input);

 {

  if (strcmp(input,"1") == 0)

  {

   system("shutdown - a");

  }

  else

  {

   goto again;

  }

 }

return 0;

}

标签:关机,again,程序,system,shutdown,input,include
From: https://blog.51cto.com/u_15858801/5826362

相关文章