越往下学就越发现,真的是基础不牢地动山摇,打算重新复习一下基础,花了半小时看了冒泡排序的理论,几分钟敲了代码
#include#define max 20 using namespace std; void Bubble_sort(int A[],int n) { int temp; for(int i=0;i A[j+1]) { temp = A[j]; A[j] = A[j+1]; A[j+1] = temp; } } } } int main() { int A[max]; int n; int i; cout<<"输入数组长度:"< >n; cout<<"输入数字元素:"< >A[i]; Bubble_sort(A,n); cout<<"排序后:"<



