/* * 程序的版权和版本声明部分 * Copyright (c)2013, 烟台大学计算机学院学生 * All rightsreserved. * 作 者:赵加响 * 完成日期:2013 年12 月 2 日 * 版本号: v1.0 * 输入描述:无 * 问题描述:数组的排序 * 程序输出: *问题分析: */ #includeusing namespace std; //两个函数bubble_sort和output_array的声明 void bubble_sort(int[],int); void output_array(int[],int); int main( ) { int a[20]= {86,76,62,58,77,85,92,80,96,88,77,67,80,68,88,87,64,59,61,76}; int b[15]= {27,61,49,88,4,20,28,31,42,62,64,14,88,27,73}; bubble_sort(a,20); output_array(a,20); cout< a[j]) { min=j; //假设下标为j的元素最小 } t=a[i]; a[i]=a[min]; a[min]=t; } } cout<<排序后的数组为:<
