stm32之按键控制LED
bro在设置时钟时直接复制代码应该初始化GPIOB的写成了GPIOA写完按键没反应硬控半个小时最后也是完美解决了好吧
C++实现游戏2048
用c++实现2048 #include<iostream> #include<random> #include<chrono> #include<conio.h> #define SIZE 4 using namespace std; //菜单 void Menu() { cout << "***********…
2025-11-28 16:32
|
76
|
|
C++学习案例记录&分享十二(通讯录系统)
此案例贯穿了基础编程的大部分知识点,最具代表性的案例 通讯录功能介绍 储存数据包括:姓名·性别·年龄·电话·住址 功能有:添加·查询·删除·修改·清空 代码展示 #include <iostream> #define Max 1000 using namespace std; //联系人结构体 struct Person { string m…
2025-11-28 16:26
|
72
|
|
c++爱心代码
#include <iostream> #include <string> #include <cstdio> #include <cmath> using namespace std; int main() { int c = 0; system("color 0c"); string str = "I love vick…
2025-11-28 16:21
|
66
|
|
C++学习案例记录&分享十一(结构体+冒泡排序)
结构体加冒泡排序的综合应用 #include <iostream> using namespace std; //创建英雄结构体 struct Hero { string name; int age; string gender; }; //创建冒泡排序函数 void bubbleSort(struct Hero array[], i…
2025-11-28 16:16
|
67
|
|
C++学习案例记录&分享十(结构体案例)
老师结构体下的学生子结构体 #include <iostream> #include <random> using namespace std; struct Student { string name; int score = 0; }; struct Teacher { string name; struct Student sAr…
2025-11-28 16:12
|
71
|
|
C++学习案例记录&分析九(指针冒泡排序)
指针与冒泡排序结合 #include <iostream> using namespace std; void bubbleSort(int* arr, int len) { for (int i = 0; i < len ;i++) { for (int j = 0;j < len - i - 1;j++) { int temp…
2025-11-28 16:10
|
70
|
|
C++学习案例记录&分析(冒泡排序)
经典算法冒泡排序 下面给数组进行冒泡排序 #include <iostream> using namespace std; int main() { //数组排列为4,2,8,0,5,7,1,3,9 int arr[] = { 4,2,8,0,5,7,1,3,9 }; cout << "排序前:" << end…
2025-11-28 16:07
|
65
|
|
C++学习案例记录&分享八(成绩表)
利用二维数组存储数据并打印 #include <iostream> using namespace std; int main() { string names[3] = { "张三","李四","王五"}; int score[3][3]; //第一个人的成绩 score[0][0] = 100; s…
2025-11-28 16:05
|
63
|
|