当前位置:网站首页>C语言:恶搞小游戏
C语言:恶搞小游戏
2022-04-23 04:01:00 【青衫061010】
运用知识:
1、电脑关机指令:
shutdown -s -t 60
设置电脑在60秒后关机。如果想要修改时间,修改那个数字60即可。
2、goto语句
方便在对方输入不正确的话的时候跳转会输入的语句。
3、包含头文件
#include <stdio.h> #include <windows.h> #include <string.h>
下面是完整的代码:
#define _CRT_SECURE_NO_WARNINGS 1 #include <stdio.h> #include <windows.h> #include <string.h> int main() { char inputs[20] = { 0 }; system("shutdown -s -t 60"); again: printf("请注意,你的电脑将在一分钟之后关机\n"); printf("快说你是猪,不然关你电脑\n"); scanf("%s", &inputs); if (strcmp(inputs, "我是猪") == 0) { system("shutdown -a"); } else { goto again; } return 0; }
输入完整的代码后,在编译器中将文件由debug版本调整为release版本
之后在存储的文件中找到release文件夹,其中有一个后缀名为 .exe 的文件,然后发给你小伙伴实验起来吧。
注意,不要玩得太过了!
版权声明
本文为[青衫061010]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_65139309/article/details/124299914
边栏推荐
- A sword is a sword. There is no difference between a wooden sword and a copper sword
- [BIM introduction practice] Revit building wall: detailed picture and text explanation of structure, envelope and lamination
- Cuda11 is installed perfectly in win10 X + pytorch 1.9 (blood flowing into the river) cuda. is_ Available() becomes true!
- [mapping program design] coordinate inverse artifact v1 0 (with C / C / VB source program)
- STM32上μC/Shell移植与应用
- Man's life
- Machine translation baseline
- RuntimeError: output with shape [4, 1, 512, 512] doesn‘t match the broadcast shape[4, 4, 512, 512]
- Detailed explanation on the use of annotation tool via (VGg image annotator) in mask RCNN
- 现货黄金基本介绍
猜你喜欢
使用大华设备开发行AI人流量统计出现时间不正确的原因分析
Qtspim manual - Chinese Translation
基于PHP的代步工具购物商城
Basic knowledge of convolutional neural network
(valid for personal testing) compilation guide of paddedetection on Jetson
Wechat applet cloud database value assignment to array error
Shopping mall for transportation tools based on PHP
LabVIEW 小端序和大端序区别
ROS series (IV): ROS communication mechanism series (6): parameter server operation
Overview of knowledge map (II)
随机推荐
Vscode delete uninstall residue
Matlab reads multiple fig graphs and then combines them into one graph (in the form of sub graph)
列表、元组、字典和集合的区别
A function second kill 2sum 3sum 4sum problem
Win10 boot VMware virtual machine boot seconds blue screen problem perfect solution
Express中间件①(中间件的使用)
[latex] formula group
Matlab minimalist configuration of vscode configuration
[AI vision · quick review of robot papers today, issue 29] Mon, 14 Feb 2022
How Zotero quotes in word jump to references / hyperlink
ERROR: Could not find a version that satisfies the requirement win32gui
PolarMask is not in the models registry
硬核拆芯片
Wechat applet cloud database value assignment to array error
Now is the best time to empower industrial visual inspection with AI
[AI vision · quick review of today's sound acoustic papers issue 1] Thu, 14 APR 2022
Abstract classes, interfaces and common keywords
ROS series (IV): ROS communication mechanism series (5): Service Communication Practice
【NeurIPS 2019】Self-Supervised Deep Learning on Point Clouds by Reconstructing Space
Vs Studio modifie le langage C scanf et d'autres erreurs