c++小程序
多壹
这个作者很懒,什么都没留下…
展开
-
c++加减乘除计算器
#include <iostream>#include <conio.h>#include <string>void main(){ char str[0xFF]; do { system("cls"); float a{}; float b{}; int count = 1; int isOperating = -1; bool isFirst = true; std::string text{ "按任意键重置,继续计算\n"原创 2020-11-13 15:58:21 · 1857 阅读 · 0 评论 -
位运算:16进制改变某个位置的值(模拟灯光开关)
#include <iostream>#include <iomanip>void bithandle(unsigned int value, int bit){ using namespace std; unsigned int temp = value; value= 0xFFFFFFFF << bit; unsigned int val0 = 0xFFFFFFFF; val0=val0 >> (32 - bit+4); value=v原创 2020-11-02 16:06:20 · 656 阅读 · 0 评论 -
C++控制台五子棋(带背景音乐)
**五子棋**#include <iostream>#include <string>#include <conio.h>#include <windows.h>#include "mmsystem.h" //BGM 函数 头文件#pragma comment(lib, "winmm.lib")HANDLE hOutput;//句柄COORD coord = { 0,0 }; //控制台屏幕上的坐标(结构体)std::string原创 2020-10-28 10:26:11 · 1418 阅读 · 1 评论 -
c++输出爱心小程序
**输入数值可以得到不同大小的爱心形状**#include <iostream>#define y x / 4#define s ((x + 1) - 3 * y) / 2 int main() { int x; std::cout << "请输入最小10,并且以加8递增:"; std::cin >> x; int a = 1; for (int i = 0; i <= x; i++) { for (int j = 0;原创 2020-10-21 20:46:53 · 8868 阅读 · 2 评论 -
c++查找文件夹中文件个数一分钟显示刷新一次
**查找文件夹中文件个数一分钟显示刷新一次**#include <iostream>#include <io.h>#include <windows.h> int _waitTime = 60;int getFileNum(const std::string& path) { struct _finddata_t fileinfo; long handle = _findfirst(path.c_str(), &fi原创 2020-10-09 22:48:25 · 255 阅读 · 0 评论