#include<iostream> using namespace std; int main() { int arr[10]={6,98,498,56,43,646,894,46,8,89}; for (int i=0;i<10;i++){ cout<<"Êý×é˳Ðò"<<i<<"µÄÊýÖµ"<<arr[i]<<endl; for (int i=0;i<10;i++){ for(int j=0;j<10;j++){ if(arr[j]>arr[j+1]){ int re; re=arr[j]; arr[j]=arr[j+1]; arr[j+1]=re; } } } } for (int i=0;i<10;i++){ cout<<"Êý×é˳Ðò"<<i<<"µÄÊýÖµ"<<arr[i]<<endl; } }
转载于:https://www.cnblogs.com/aipopo/p/7872219.html