Cod sursa(job #1032854)
Utilizator | Data | 16 noiembrie 2013 10:02:28 | |
---|---|---|---|
Problema | Sortare prin comparare | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.41 kb |
#include<fstream>
#include<algorithm>
#include<vector>
using namespace std;
ifstream fin("algsort.in");
ofstream fout("algsort.out");
vector<int>v;
vector<int>::iterator it;
int n,x;
int main(){
fin>>n;
for(;n--;){
fin>>x;
v.push_back(x);
}
sort(v.begin(),v.end());
for(it=v.begin();it!=v.end();it++){
fout<<*it<<" ";
}
return 0;
}