摘要: 1.题目如下: C++用函数重载实现两个整数和三个浮点数的排序,按照从小到大的顺序将排序结果输出 2.来吧,展示: #include <iostream> using namespace std; void sort(int a,int b) { int temp; if (a>b){temp = 阅读全文
posted @ 2020-10-11 16:35 攻城狮小关 阅读(1220) 评论(0) 推荐(0) 编辑
摘要: 1.题目要求如下: C++用引用形参实现两个变量的值互换 2.来吧,展示: #include <iostream> using namespace std; void swap(int &a,int &b) { int temp; temp=a; a=b; b=temp; } int main() 阅读全文
posted @ 2020-10-11 16:31 攻城狮小关 阅读(864) 评论(0) 推荐(0) 编辑
摘要: 1.题目要求如下: C++用带有默认参数的函数实现,求2个或3个正整数中的最大数 2.来吧,展示: #include <iostream> using namespace std; void sort(int a,int b) { int temp; if (a>b){temp = a;a = b; 阅读全文
posted @ 2020-10-11 16:03 攻城狮小关 阅读(2711) 评论(0) 推荐(0) 编辑