欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標題:
c++冒泡法排序程序
[打印本頁]
作者:
daming
時間:
2014-12-30 15:54
標題:
c++冒泡法排序程序
#include<iostream>
using namespace std;
void main()
{
int temp,i;
int array[]={3,5,9,11,7,-9,32,20,123,103};
cout<<"排序前的數組為:";
for(i=0;i<10;i++)
cout<<array[i]<<",";
cout<<endl;
for(int pass=0;pass<9;pass++)
{
for(i=0;i<9-pass;i++)
{
if(array[i]>array[i+1])
{
temp=array[i];
array[i]=array[i+1];
array[i+1]=temp;
}
}
}
cout<<"排序后的數組為:";
for(i=0;i<10;i++)
cout<<array[i]<<",";
cout<<endl;
}
復制代碼
歡迎光臨 (http://m.raoushi.com/bbs/)
Powered by Discuz! X3.1