Cod sursa(job #1109158)

Utilizator denis_tdrdenis tdr denis_tdr Data 16 februarie 2014 19:37:56
Problema Sortare prin comparare Scor 60
Compilator cpp Status done
Runda Arhiva educationala Marime 0.37 kb
#include <set>
#include <iostream>
#include <fstream>
using namespace std;
// cu heap
multiset <int> mset;
multiset <int> ::iterator it;


int main() {
    ifstream f("algsort.in");
    ofstream g("algsort.out");
    int n,x;
    f>>n;
    while(f>>x)
        mset.insert(x);
    it=mset.begin();
    while(it!=mset.end())
        g<<*it++<<" ";
    return 0;
}