摘要: #include#includeusing namespace std;/* 结构体指针 可以通过操作符'->'访问结构体中的成员(属性)*/struct Student{ string name; int age; int sc... 阅读全文
posted @ 2021-03-11 12:04 yub4by 阅读(26) 评论(0) 推荐(0)
摘要: #include#includeusing namespace std;/* 结构体数组 将自定义的结构体放入数组中 方便维护*/struct Student{ string name; int age; int score;};... 阅读全文
posted @ 2021-03-11 12:03 yub4by 阅读(70) 评论(0) 推荐(0)
摘要: #include#includeusing namespace std;/* 结构体 一些数据类型的集合 用户自定义的数据类型 允许存放不同的数据类型*/// 结构体定义struct Student{ string name; ... 阅读全文
posted @ 2021-03-10 18:46 yub4by 阅读(29) 评论(0) 推荐(0)
摘要: #includeusing namespace std;int main(){ //3 跳转语句 //3-2 continue //循环语句中,跳过本次循环中余下未执行的语句,直接执行下一次循环 //区别:break会直接退出循环而不再... 阅读全文
posted @ 2021-03-10 13:30 yub4by 阅读(63) 评论(0) 推荐(0)
摘要: #includeusing namespace std;int main(){ //2 循环结构 //2-4 嵌套循环 for (int i=0; i 列数> select; switch (select){ case 1: ... 阅读全文
posted @ 2021-03-10 13:30 yub4by 阅读(111) 评论(0) 推荐(0)
摘要: #includeusing namespace std;int main(){ //2 循环结构 //2-3 for(起始表达式0;条件表达式1;末尾循环体2){循环语句3} //起始表达式仅执行1次;执行顺序:0 123 123 123 .... 阅读全文
posted @ 2021-03-10 13:30 yub4by 阅读(101) 评论(0) 推荐(0)
摘要: #includeusing namespace std;int main(){ //2 循环结构 //2-2 do-while int num = 0; do{ cout << num << endl; nu... 阅读全文
posted @ 2021-03-10 13:29 yub4by 阅读(59) 评论(0) 推荐(0)
摘要: #include#include#include //随机数用到#include //时间用到using namespace std;int main(){ //2 循环结构 //2-1 while int num = 0; whi... 阅读全文
posted @ 2021-03-10 13:29 yub4by 阅读(111) 评论(0) 推荐(0)
摘要: #include#includeusing namespace std;int main(){ //程序流程结构:顺序结构 选择结构 循环结构 //1 选择结构 //1-1单行if语句 if(){} //1-2多行if语句 if(){}... 阅读全文
posted @ 2021-03-10 13:29 yub4by 阅读(82) 评论(0) 推荐(0)
摘要: #include#includeusing namespace std;int main(){ /* 二维数组的数组名 查看二维数组所占内存空间 获取二维数组首地址 */ // 1 int ar... 阅读全文
posted @ 2021-03-10 13:28 yub4by 阅读(55) 评论(0) 推荐(0)