摘要: #include<iostream>#include<string>#define Max 1000//注意没有分号using namespace std;//定义联系人结构体struct people{ string m_name; int m_age; //以零代表男1代表女 int m_sex 阅读全文
posted @ 2020-07-11 12:32 sea,horse 阅读(155) 评论(0) 推荐(0)
摘要: //冒泡排序:相邻俩个数进行比较,每进行一趟最大值或最小值都在最右边 所以进行的总趟数是数组大小-1 #include<stdio.h>#include<time.h>int main(void){ int i, j, b; int a[5] = { NULL }; srand(time(NULL) 阅读全文
posted @ 2020-06-04 20:50 sea,horse 阅读(78) 评论(0) 推荐(0)
摘要: 选择排序:是默认为a[0]为最大值或最小值 #include<stdio.h>#include<time.h>int main(void){ int i,j, b; int a[5] = { NULL }; srand(time(NULL));//产生随机数种子 for (i = 0; i < 5; 阅读全文
posted @ 2020-06-04 15:42 sea,horse 阅读(46) 评论(0) 推荐(0)