本题新做法
查看原帖
本题新做法
134305
Mzh008楼主2022/11/8 14:23
#include<bits/stdc++.h>
using namespace std;
int n,a[11];
bool Check(){
	for(int i=2;i<=3;++i) 
    		if(a[i]<a[i-1]) 
            		return false;
 	return true;
} 
int main(){
	for(int i=1;i<=3;++i) cin>>a[i];
	while(!Check()) 
    		random_shuffle(a+1,a+4);
	for(int i=1;i<=3;++i) 
    		cout<<a[i]<<" ";
	return 0;
}
2022/11/8 14:23
加载中...