Cod sursa(job #977227)
Utilizator | Data | 25 iulie 2013 10:35:00 | |
---|---|---|---|
Problema | Sortare prin comparare | Scor | 60 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.4 kb |
#include <fstream>
#include <set>
using namespace std;
ifstream f("algsort.in");
ofstream g("algsort.out");
int n, x, i;
multiset <int> s;
multiset <int>::iterator it;
int main(){
f>>n;
for(i=1; i<=n; i++)
{
f>>x;
s.insert(x);
}
f.close();
for(it=s.begin(); it!=s.end(); it++)
g<<*it<<' ';
g<<"\n";
g.close();
return 0;
}