#include<iostream>
using namespace std;
void bubble(int l [],int n){// 使用中间变量temp实现互换
int i,temp,exchange=n,j;
while(exchange){
j=exchange;
exchange=0;
for(i=0;i<j;i++){
if(l[i]>l[i+1]){
temp=l[i];
l[i]=l[i+1];
l[i+1]=temp;
exchange=i+1;
}
}
}
}
void bubble2(int l [],int n){// 不借助中间变量
int i,exchange=n,j;
while(exchange){
j=exchange;
exchange=0;
for(i=0;i<j;i++){
if(l[i]>l[i+1]){
l[i]=l[i]+l[i+1];
l[i+1]=l[i]-l[i+1];
l[i]=l[i]-l[i+
using namespace std;
void bubble(int l [],int n){// 使用中间变量temp实现互换
int i,temp,exchange=n,j;
while(exchange){
j=exchange;
exchange=0;
for(i=0;i<j;i++){
if(l[i]>l[i+1]){
temp=l[i];
l[i]=l[i+1];
l[i+1]=temp;
exchange=i+1;
}
}
}
}
void bubble2(int l [],int n){// 不借助中间变量
int i,exchange=n,j;
while(exchange){
j=exchange;
exchange=0;
for(i=0;i<j;i++){
if(l[i]>l[i+1]){
l[i]=l[i]+l[i+1];
l[i+1]=l[i]-l[i+1];
l[i]=l[i]-l[i+