C++ 结构体案例2 升序打印数组中的元素
摘要:1 //结构体案例 2 2 #include<iostream> 3 #include<string> 4 #include<ctime> 5 using namespace std; 6 7 struct Hero 8 { 9 string name; 10 int age; 11 string
阅读全文
posted @
2021-08-04 11:12
Bytezero!
阅读(212)
推荐(0) 编辑
C++ 结构体+数组+取随机数 案例(打印3名老师 带着 5名学生)结构体
摘要:1 //结构体案列 2 3 #include<iostream> 4 #include<string> 5 #include<ctime> 6 using namespace std; 7 8 //学生的结构体 9 struct Student 10 { 11 string sName; 12 in
阅读全文
posted @
2021-08-04 09:50
Bytezero!
阅读(220)
推荐(0) 编辑
C++ 打印乘法口诀
摘要:1 //嵌套循环 乘法口诀 2 #include <iostream> 3 using namespace std; 4 int main() 5 { 6 int i ,j; 7 for ( i = 1; i <= 9; i++) 8 { 9 for (j = 1; j <= i; j++) 10
阅读全文
posted @
2021-08-02 14:44
Bytezero!
阅读(197)
推荐(0) 编辑
C++1-100之间 7的倍数 带7 打印 敲桌子
摘要:1 // 1-100之间 7的倍数 带7 打印 敲桌子 2 #include <iostream> 3 using namespace std; 4 5 int main() 6 { 7 for (int i = 1; i <= 100; i++) 8 { 9 if(i % 7==0 || i %
阅读全文
posted @
2021-08-02 13:59
Bytezero!
阅读(409)
推荐(0) 编辑
C++水仙花 (如:153 = 1*1*1 + 5*5*5 + 3*3*3)
摘要:1 #include <iostream> 2 #include <ctime> 3 using namespace std; 4 5 int main() 6 { 7 int num = 100; 8 do 9 { 10 int a = 0; 11 int b = 0; 12 int c = 0;
阅读全文
posted @
2021-08-02 11:11
Bytezero!
阅读(120)
推荐(0) 编辑