Cod sursa(job #1032844)
| Utilizator | Data | 16 noiembrie 2013 09:52:47 | |
|---|---|---|---|
| Problema | Sortare prin comparare | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.43 kb |
#include <fstream>
#include <vector>
#include <algorithm>
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;
while (n--){
fin>>x;
v.push_back(x);
}
sort (v.begin(),v.end());
for (it=v.begin();it<v.end();it++)
fout<<*it<<" ";
fout<<"\n";
return 0;
}
