镇乃天子
This commit is contained in:
39
188.cpp
Normal file
39
188.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
int main(){
|
||||
int a[5];
|
||||
int max;
|
||||
bool bl=true;
|
||||
cout<<"请输入5个整数"<<endl;
|
||||
for(int i=0;i<5;i++)
|
||||
{
|
||||
cin>>a[i];
|
||||
}
|
||||
for(int i=0;i<5;i++)
|
||||
{
|
||||
for(int j=0;j<4-i;j++)
|
||||
{
|
||||
if(a[j]>a[j+1])
|
||||
{
|
||||
max=a[j];
|
||||
a[j]=a[j+1];
|
||||
a[j+1]=max;
|
||||
bl=false;
|
||||
}
|
||||
if(!bl)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
for(int n=0;n<5;n++) {
|
||||
|
||||
cout<<a[n]<<" ";
|
||||
|
||||
}
|
||||
}
|
||||
cout<<endl;
|
||||
|
||||
cout<<"阿哈哈哈啊哈哈哈哈,我我没有输出!!!"<<endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user