以下程序调用函数 用选择法对数组中的值按降序排序 请完成程序。 #include<iostream> using

大学网课 已帮助 人

以下程序调用函数,用选择法对数组中的值按降序排序,请完成程序。 #include<iostream> using namespace std; void sortd(,int n) { int i, j, p, t; for(i=0; i<n-1; i++) { ; for(; ; j++) if(a[j]>a[p] ) p=j; if(p!=i) { t=a[i]; a[i]=a[p]; a[p]=t; } } } void main() { int a[10]; for(int i=0; i<10; i++) cin>>a[i]; sortd(a, 10); for(i=0; i<10; i++) cout<<a[i]<<"t"; cout<<"n"; }

以下程序调用函数 用选择法对数组中的值按降序排序 请完成程序。 #include&lt;iostream&gt; using

热搜:fun函数的功能是求3行4列二维数组每行元素中的最大值