Cod sursa(job #1520854)
| Utilizator | Data | 9 noiembrie 2015 16:48:49 | |
|---|---|---|---|
| Problema | Sortare prin comparare | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.4 kb |
// algsort
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
ifstream f("algsort.in");
ofstream g("algsort.out");
int n;
vector<int> V;
void read() {
f>>n;
for (int i=1;i<=n;i++) {
int x; f>>x;
V.pb(x);
}
}
void output() {
for (unsigned i=0;i<V.size();i++) {
g<<V[i]<<' ';
}
}
int main() {
read();
sort(V.begin(), V.end());
output();
f.close(); g.close();
return 0;
}
