当前位置:网站首页>Computer shutdown program
Computer shutdown program
2022-04-23 07:19: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(" Your computer will shut down in a minute , Please enter : I am a pig , You can cancel the shutdown program \n Please enter :");
scanf("%s", input);
if (strcmp(input, " I am a pig ") == 0)
{
system("shutdown -a");//abolish
}
else
{
goto again;
}
return 0;
}
// It can also be used. while Statement implementation program
int main()
{
char input[20] = {
0 };
system("shutdown -s -t 60");//set and time
while (1)
{
printf(" Your computer will shut down in a minute , Please enter : I am a pig , You can cancel the shutdown program \n Please enter :");
scanf("%s", input);
if (strcmp(input, " I am a pig ") == 0)
{
system("shutdown -a");//abolish
break;
}
}
return 0;
}
版权声明
本文为[Amyniez]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230610096538.html
边栏推荐
- 深度学习模型压缩与加速技术(一):参数剪枝
- MySQL数据库安装与配置详解
- Gephi教程【1】安装
- MySQL笔记3_约束_主键约束
- C# EF mysql更新datetime字段报错Modifying a column with the ‘Identity‘ pattern is not supported
- What did you do during the internship
- Android清除应用缓存
- Component learning (2) arouter principle learning
- 【動態規劃】不同路徑2
- MySQL5. 7 insert Chinese data and report an error: ` incorrect string value: '\ xb8 \ XDF \ AE \ xf9 \ X80 at row 1`
猜你喜欢
随机推荐
第5 章 机器学习基础
HandlerThread原理和实际应用
【2021年新书推荐】Red Hat RHCSA 8 Cert Guide: EX200
adb shell 常用命令
Itop4412 LCD backlight drive (PWM)
Android清除应用缓存
Record WebView shows another empty pit
Gephi教程【1】安装
Keras如何保存、加载Keras模型
Itop4412 HDMI display (4.4.4_r1)
【2021年新书推荐】Practical IoT Hacking
Exploration of SendMessage principle of advanced handler
PyTorch 模型剪枝实例教程三、多参数与全局剪枝
Pytorch trains the basic process of a network in five steps
MySQL notes 1_ database
ThreadLocal,看我就够了!
WebView displays a blank due to a certificate problem
Itop4412 surfaceflinger (4.4.4_r1)
[dynamic programming] longest increasing subsequence
【2021年新书推荐】Kubernetes in Production Best Practices









