当前位置:网站首页>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
边栏推荐
- Add the compiled and installed Mysql to the path environment variable
- PolarMask is not in the models registry
- LabVIEW 小端序和大端序区别
- Paddlepaddle does not support arm64 architecture.
- [AI vision · quick review of robot papers today, issue 30] Thu, 14 APR 2022
- Vs Studio modifie le langage C scanf et d'autres erreurs
- VHDL语言实现32位二进制数转BCD码
- [AI vision · quick review of robot papers today, issue 29] Mon, 14 Feb 2022
- 【NeurIPS 2019】Self-Supervised Deep Learning on Point Clouds by Reconstructing Space
- [AI vision · quick review of NLP natural language processing papers today, issue 30] Thu, 14 APR 2022
猜你喜欢

Paddlepaddle model to onnx

【Echart】echart 入門

Opencv4 QR code recognition test
![[AI vision · quick review of robot papers today, issue 30] Thu, 14 APR 2022](/img/93/55ee30b99c7683edc612a09e30dfed.png)
[AI vision · quick review of robot papers today, issue 30] Thu, 14 APR 2022

Express middleware ② (classification of Middleware)

【BIM+GIS】ArcGIS Pro2.8如何打开Revit模型,BIM和GIS融合?
![[AI vision · quick review of NLP natural language processing papers today, issue 29] Mon, 14 Feb 2022](/img/34/1db76ac50888196515927fe51b2738.png)
[AI vision · quick review of NLP natural language processing papers today, issue 29] Mon, 14 Feb 2022

Abstract classes, interfaces and common keywords

LabVIEW 小端序和大端序区别

Process seven state transition diagram
随机推荐
作为一名码农,女友比自己更能码是一种什么体验?
Cuda11 is installed perfectly in win10 X + pytorch 1.9 (blood flowing into the river) cuda. is_ Available() becomes true!
小红书被曝整体裁员20%,大厂之间内卷也很严重
【ICCV 2019】MAP-VAE:Multi-Angle Point Cloud-VAE: Unsupervised Feature Learning for 3D Point Clouds..
Hard core chip removal
Overview of knowledge map (II)
Why recommend you to study embedded
Operating skills of spot gold_ Wave estimation curve
【ICCV 2019】MAP-VAE:Multi-Angle Point Cloud-VAE: Unsupervised Feature Learning for 3D Point Clouds..
VS Studio 修改C語言scanf等報錯
【李宏毅2022 机器学习春】hw6_GAN(不懂..)
Picture synthesis video
Xiaohongshu was exposed to layoffs of 20% as a whole, and the internal volume among large factories was also very serious
Opencv -- yoact case segmentation model reasoning
Vs Studio modifie le langage C scanf et d'autres erreurs
Network principle | connection management mechanism in TCP / IP important protocol and core mechanism
Shopping mall for transportation tools based on PHP
创下国产手机在海外市场销量最高纪录的小米,重新关注国内市场
Basic usage of Google colab (I)
Abstract classes, interfaces and common keywords