Cod sursa(job #744593)
Utilizator | Data | 9 mai 2012 10:31:02 | |
---|---|---|---|
Problema | Sortare prin comparare | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.25 kb |
#include <fstream>
#include <algorithm>
using namespace std;
int n,i;
int v[500002];
ifstream f("algsort.in");
ofstream g("algsort.out");
int main(){
f>>n;
for (i=1;i<=n;i++) {f>>v[i];}
sort(v+1,v+n+1);
for (i=1;i<=n;i++) {g<<v[i]<<' ';}
}