Run ID:93416

提交时间:2024-10-13 20:42:57

# include<bits/stdc++.h> using namespace std; int main(){ int a[100]; queue <int> q; for(int i=1;i<=30;i++){ q.push(i); } while(q.empty()==false){ for(int i=1;i<9;i++){ q.push(q.front()); q.pop(); }q.pop(); if(q.size()==15){ break; } } for(int i=1;i<=15;i++){ a[i]=q.front(); q.pop(); } for(int i=1;i<15;i++){ for(int j=i+1;j<=15;j++){ if(a[i]>a[j]){ swap(a[i],a[j]); } } }for(int i=1;i<=15;i++){ cout<<a[i]<<" "; } return 0; }