help!!!!!!
查看原帖
help!!!!!!
1178856
DumbTrash楼主2024/7/12 19:15
#include<iostream>
using namespace std;
int s[2000001];
int main(){
    int a,b;
    ios::sync_with_stdio(false);
	cin>>a>>b;	
    for(int i=1;i<=b;i++)
    {
    	ios::sync_with_stdio(false);
        cin>>s[i];
    }
    for(int i=2;i<=b;i++)
    {
        for(int j=1;j<i;j++)
        {
            if(s[j]>s[i])
            swap(s[j],s[i]);
        }
    }
    for(int i=1;i<=b;i++)
    {
    	ios::sync_with_stdio(false);
        cout<<s[i]<<" ";
    }
    return 0;
}
2024/7/12 19:15
加载中...