当前位置:网站首页>Basic part of C language: shutdown applet
Basic part of C language: shutdown applet
2022-07-17 22:52:00 【Tiger Taro's inheritance】
Catalog
One 、 Design thinking
Shutdown Sequence
Just run , The computer will shut down in a minute , If input : I am a pig , Will cancel the shutdown .
Two 、 Programming
1. Include header file
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
2. operation
//shutdowm -> Shutdown widget
//-s -> Set shutdown
//-t -> Set the time to shut down
//-a -> Set to cancel shutdown
3. The main function
int main()
{
char input[20] = {
0 };
system("shutdown -s -t 60");
again:
printf(" Please note that , Your computer is 1 Shut down in minutes , If input : I am a pig , Will cancel the shutdown \n");
scanf("%s", input);
if (strcmp(input," I am a pig ") == 0)// Two string comparisons cannot use the equal sign
{
system("shutdown -a");
}
else
{
goto again;
}
return 0;
}
3、 ... and 、 Effect display


边栏推荐
- Yanrong full flash x NVIDIA Infiniband: creating a high-performance storage technology for GPU computing in the AI Era
- c语言基础篇:操作符
- Migrate data files in RMAN copy mode
- Install Emmet plug-in for notepad++
- Tab bar switching - simulate the mobile phone to switch viewports with the tab
- Graphic array calculation module numpy (specify numerical type, numerical type, two-dimensional array index, two-dimensional array slice index, array remodeling, array addition, deletion, modification
- 数据库配置白/黑名单
- AccessClient插件在苹果电脑闪退
- What is the relationship between database and schema in oracle?
- rman copy 方式迁移数据文件
猜你喜欢

scratch绘制多变的正方形 电子学会图形化编程scratch等级考试四级真题和答案解析2022年6月

关于NLP自监督学习,面试时被问崩溃了!

【Debug】VS EXE运行“应用程序无法正常启动(0xc000007b)”

APP&web测试工具

AI 之 OpenCvSharp 大图找小图(案例版)

开源篇--精准定位 模型重心坐标

Yanrong full flash x NVIDIA Infiniband: creating a high-performance storage technology for GPU computing in the AI Era

List集合

阿里巴巴达摩院对话团队招聘研究实习生!

wx小程序学习笔记day02
随机推荐
How to turn off win11 speech recognition?
PolarDB for PostgreSQL的存储接口支持什么形式的磁盘存储?
【无标题】
陆面生态水文模拟与多源遥感数据同化与Noah-MP模型
Quelle est la relation entre l'espace de table d'Oracle et la base de données?
Hybrid domain attention mechanism CBAM in CNN
R data analysis: practical operation of clinical prediction models, examples of calibration curves and DCA curves
List collection
【mysql】mysql分别按年/月/日/周分组统计数据
How to start polardb for PostgreSQL?
数组的理解与操作
221. 最大正方形
Reinstallation method of U disk startup disk of win10 system
221. Largest square
Solution of word moving right automatically as soon as you switch pages
c语言基础篇:关机小程序
How does polardb for PostgreSQL view the database alarm log?
Win11 method tutorial of deleting English input method
美国政府将对太阳能产品制造项目投入5600万美元
wx小程序学习笔记day02