fqy131314

2022年7月22日

实现一个函数,函数完成功能如下:

摘要: 1.函数的输入为一个数组,数组的成员个数不定(即:可能为0,也可能为多个) 2.函数找到成员的最大元素和最小元素,并能让函数的调用者知道最大元素和最小元素是哪一个 #include <iostream> #include <Windows.h> using namespace std; bool m 阅读全文

posted @ 2022-07-22 11:54 会飞的鱼-blog 阅读(26) 评论(0) 推荐(0)

有一个整型数组,a[3]={2,3,7};要求使用指针实现数组成员从小到大的顺序排列。

摘要: #include <iostream> #include <Windows.h> using namespace std; void sort(int *b) { int tmp; for(int i=0;i<3;i++) { for(int j=i;j<3;j++) { if(b[i]>b[j]) 阅读全文

posted @ 2022-07-22 11:32 会飞的鱼-blog 阅读(15) 评论(0) 推荐(0)

用C++实现字符的逆转

摘要: #include <iostream> #include <Windows.h> #include <string.h> using namespace std; void reverse(unsigned char *a) { unsigned char *p1=a; unsigned char 阅读全文

posted @ 2022-07-22 11:17 会飞的鱼-blog 阅读(23) 评论(0) 推荐(0)

导航