#rooot怎么做????

lhy221 嘴强王者 2025-11-16 16:14:33 5

#include<bits/stdc++.h> using namespace std; long long b[500009]; int main(){ int n,a; cin>>n; for(int i=1;i<=n;i++){ cin>>b[i]; if(b[i+1]>b[i]){ b[i]==b[i+1]; } } for(int i=1;i<=n;i++){ cout<<b[i]<<" "; } return 0; }

{{ vote && vote.total.up }}

共 1 条回复

wc022 CSP-J2二等

@lhy221

你咋不问ZP?

你要用用sort函数排序

sort (你设置的数组名+1,你的数组名+n+1);

这样你的数组就排好序了,不过这个函数有个缺点:只能从小到大排,要从大到小排还要倒叙输出