当前位置:网站首页>电脑关机程序
电脑关机程序
2022-04-23 06:10:00 【Amyniez】
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char input[20] = {
0 };
system("shutdown -s -t 60");//set and time
again:
printf("您的电脑将在一分钟之后关闭,请输入:我是猪,就可以取消关机程序\n请输入:");
scanf("%s", input);
if (strcmp(input, "我是猪") == 0)
{
system("shutdown -a");//abolish
}
else
{
goto again;
}
return 0;
}
//也可以用while语句实现程序
int main()
{
char input[20] = {
0 };
system("shutdown -s -t 60");//set and time
while (1)
{
printf("您的电脑将在一分钟之后关闭,请输入:我是猪,就可以取消关机程序\n请输入:");
scanf("%s", input);
if (strcmp(input, "我是猪") == 0)
{
system("shutdown -a");//abolish
break;
}
}
return 0;
}
版权声明
本文为[Amyniez]所创,转载请带上原文链接,感谢
https://blog.csdn.net/amyniez/article/details/122724169
边栏推荐
猜你喜欢
Component based learning (1) idea and Implementation
this.getOptions is not a function
【2021年新书推荐】Effortless App Development with Oracle Visual Builder
统一任务分发调度执行框架
红外传感器控制开关
AVD Pixel_2_API_24 is already running.If that is not the case, delete the files at C:\Users\admi
ThreadLocal,看我就够了!
WebView displays a blank due to a certificate problem
常用UI控件简写名
Itop4412 HDMI display (4.0.3_r1)
随机推荐
iTOP4412 SurfaceFlinger(4.0.3_r1)
Oracle索引状态查询与索引重建
What did you do during the internship
DCMTK (dcm4che) works together with dicoogle
Easyui combobox 判断输入项是否存在于下拉列表中
組件化學習
谷歌AdMob广告学习
Component based learning (1) idea and Implementation
[SM8150][Pixel4]LCD驱动
Itop4412 surfaceflinger (4.4.4_r1)
【2021年新书推荐】Effortless App Development with Oracle Visual Builder
MySQL notes 4_ Primary key auto_increment
【2021年新书推荐】Practical Node-RED Programming
Cause: dx. jar is missing
xcode 编译速度慢的解决办法
MySQL笔记5_操作数据
iTOP4412内核反复重启
个人博客网站搭建
Cause: dx.jar is missing
补补网络缺口