Cod sursa(job #822718)

Utilizator icb_mnStf Cic icb_mn Data 23 noiembrie 2012 22:38:10
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;
multiset<int>s;
int main()
{
    f>>n;
    int el;
    for(int i = 1; i <= n; ++i)
    {
        f>>el;
        s.insert(el);
    }
    typedef multiset<int>::iterator IT;
    for(IT it = s.begin(); it != s.end(); ++it) g<<(*it)<<' ';
    g<<'\n';
    g.close();
    return 0;
}