Cod sursa(job #1122677)
Utilizator | Data | 25 februarie 2014 19:49:38 | |
---|---|---|---|
Problema | Sortare prin comparare | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.38 kb |
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
ifstream f("algsort.in");
ofstream g("algsort.out");
vector<int> v;
int n,x;
int main(){
f>>n;
while(f>>x) v.push_back(x);
sort(v.begin(), v.end());
vector<int>::iterator it;
it=v.begin();
while(it!=v.end())
g<<*it++<<" ";
return 0;
}