摘要: 1.选择排序 每一次找出最小的值,放在最前面的位置,一个一个安置 //选择排序 #include<iostream> #include<climits> using namespace std; template<class T> void gcd(T a[],int n){ int mix,tem 阅读全文
posted @ 2019-02-03 22:19 Hello_World2020 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 构造一个新数组,将对应位置的数字,从大到小或从小到大排序的名次存储,并输出 //计算名次 #include<iostream> #include<cstring> using namespace std; int book[101]; void rank(int *a,int n,int book[ 阅读全文
posted @ 2019-02-03 22:13 Hello_World2020 阅读(137) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> using namespace std; template<class T> T ploy(T *coeff,int n,const T&x){ T value=coeff[n]; for(int i=1;i<=n;i++) value=value*x+coef 阅读全文
posted @ 2019-02-03 22:10 Hello_World2020 阅读(269) 评论(0) 推荐(0) 编辑