#29934: __答案


yp11052104@yphs.tp.edu.tw (907-09施宛妘)


#include<bits/stdc++.h>

using namespace std;

int main()

{

ios::sync_with_stdio(false);//關閉c++的I/O同步

int n;

while(cin>>n,n!=0)

{

int a[n];

for(int i=0; i<n; i++) cin>>a[i];

sort(a,a+n);//對a[0]-a[n]的排序 

for(int i=0; i<n; i++) cout<<a[i]<<" ";

cout<<'\n';

 

}

 

#29936: Re:答案


yp11051231@yphs.tp.edu.tw (910-36 楊宸)


#include<bits/stdc++.h>

using namespace std;

int main()

{

ios::sync_with_stdio(false);//關閉c++的I/O同步

int n;

while(cin>>n,n!=0)

{

int a[n];

for(int i=0; i<n; i++) cin>>a[i];

sort(a,a+n);//對a[0]-a[n]的排序 

for(int i=0; i<n; i++) cout<<a[i]<<" ";

cout<<'\n';

 

}

 

不要傳答案,給其他人思考的機會。