摘要:
1 #include <iostream> 2 #include <ctime> 3 using namespace std; 4 struct student 5 { 6 string s_name; 7 int age; 8 int score; 9 }; 10 struct teacher 1 阅读全文
posted @ 2022-03-13 18:43
赵凤武
阅读(51)
评论(0)
推荐(0)
摘要:
#include <iostream> using namespace std; struct student { string name; int age; int score; }; void printstudent1(struct student s)//值传递 { s.age=100; c 阅读全文
posted @ 2022-03-13 18:08
赵凤武
阅读(35)
评论(0)
推荐(0)
摘要:
#include <iostream>using namespace std; struct Student{ string name; int age; int score;};struct teacher{ int id; string name; int age; struct Student 阅读全文
posted @ 2022-03-13 17:56
赵凤武
阅读(38)
评论(0)
推荐(0)
摘要:
1 #include <iostream> 2 using namespace std; 3 struct Student 4 { 5 string name; 6 int age; 7 int score; 8 }; 9 int main() { 10 Student s = {"张三",18,1 阅读全文
posted @ 2022-03-13 17:46
赵凤武
阅读(24)
评论(0)
推荐(0)
摘要:
1 #include <iostream> 2 using namespace std; 3 struct Student 4 { 5 string name; 6 int age; 7 int score; 8 }; 9 int main() { 10 struct Student stuArra 阅读全文
posted @ 2022-03-13 17:38
赵凤武
阅读(52)
评论(0)
推荐(0)
摘要:
1 #include <iostream> 2 using namespace std; 3 int main() { 4 struct student 5 { 6 string name; 7 int age; 8 int score; 9 }s3;//第三种 定义结构体时顺便创建 10 stru 阅读全文
posted @ 2022-03-13 17:27
赵凤武
阅读(31)
评论(0)
推荐(0)
摘要:
#include <iostream> using namespace std; int main() { //指针和数组 int arr[10]={0,1,2,3,4,5,6,7,8,9}; int *p=arr;//数组名就是数组的首地址 for(int i=0;i<10;i++) { //co 阅读全文
posted @ 2022-03-13 16:59
赵凤武
阅读(29)
评论(0)
推荐(0)
摘要:
1 #include <iostream> 2 using namespace std; 3 int main() { 4 //const修饰指针 5 //1.const修饰指针 常量指针 指针指向的值不能改 只能改指向的地址 6 //2.const修饰常量 指针常量 指针指向的值可以改 不能改指向 阅读全文
posted @ 2022-03-13 16:51
赵凤武
阅读(30)
评论(0)
推荐(0)
摘要:
1 #include <iostream> 2 using namespace std; 3 int main() { 4 //二维数组成绩统计 5 // 语文 数学 英语 6 //张三 100 100 100 7 //李四 90 50 100 8 //王五 60 70 80 9 //创建二维数组 阅读全文
posted @ 2022-03-13 14:53
赵凤武
阅读(40)
评论(0)
推荐(0)
摘要:
1 #include <iostream> 2 using namespace std; 3 int main() { 4 //冒泡排序 例:4280571396 5 //1.比较相邻元素如多第一个比第二个大 就交换 6 //2.对每一个相邻元素做相同工作,执行完毕找到第一个最大值 7 //3.重读 阅读全文
posted @ 2022-03-13 14:30
赵凤武
阅读(43)
评论(0)
推荐(0)
摘要:
1 #include <iostream> 2 using namespace std; 3 int main() { 4 //一维数组练习 5 //五只小猪称体重 例:int arr[5]={300,350,200,400,250}; 6 //找出最重打印 访问数组中每个元素,如果比我认定的最大值 阅读全文
posted @ 2022-03-13 14:13
赵凤武
阅读(57)
评论(0)
推荐(0)
摘要:
1 #include <iostream> 2 using namespace std; 3 int main() { 4 //一维数组组名 数组名是常量 不能赋值 5 //1.统计整个数组在内存长度 6 //2.可以获取数组在内存中的首地址 7 int arr[10]={1,2,3,4,5,6,7 阅读全文
posted @ 2022-03-13 13:44
赵凤武
阅读(59)
评论(0)
推荐(0)
摘要:
1 #include <iostream> 2 using namespace std; 3 int main() { 4 //goto语句 5 //跳过中间的语句 6 cout<<"1"<<endl; 7 goto FLAG; 8 cout<<"2"<<endl; 9 cout<<"3"<<end 阅读全文
posted @ 2022-03-13 13:27
赵凤武
阅读(31)
评论(0)
推荐(0)

浙公网安备 33010602011771号