当前位置:网站首页>电脑关机程序
电脑关机程序
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
边栏推荐
- Itop4412 kernel restarts repeatedly
- JS 比较2个数组中不同的元素
- oracle用delete删除数据所需时间测试
- [2021 book recommendation] artistic intelligence for IOT Cookbook
- oracle对表字段的修改
- AVD Pixel_ 2_ API_ 24 is already running. If that is not the case, delete the files at C:\Users\admi
- 【2021年新书推荐】Artificial Intelligence for IoT Cookbook
- MySQL笔记5_操作数据
- 【2021年新书推荐】Red Hat Certified Engineer (RHCE) Study Guide
- iTOP4412无法显示开机动画(4.0.3_r1)
猜你喜欢
随机推荐
[recommendation of new books in 2021] practical IOT hacking
npm ERR code 500解决
【2021年新书推荐】Red Hat Certified Engineer (RHCE) Study Guide
读书小记——Activity
从0开始封装一套项目的网络请求框架
开篇:双指针仪表盘的识别
Cause: dx.jar is missing
Viewpager2 realizes Gallery effect. After notifydatasetchanged, pagetransformer displays abnormal interface deformation
Three methods to realize the rotation of ImageView with its own center as the origin
Abnormal record-22
通过rownum来进行区间查询
第三篇:docker安装mysql容器(自定义端口)
数据库的事务
SSL/TLS应用示例
org.xml.sax.SAXParseException; lineNumber: 141; columnNumber: 252; cvc-complex-type.2.4.a: 发现了以元素 ‘b
MySQL notes 1_ database
MySQL notes 3_ Restraint_ Primary key constraint
winform滚动条美化
iTOP4412内核反复重启
三种实现ImageView以自身中心为原点旋转的方法









