Cod sursa(job #1122672)
Utilizator | Data | 25 februarie 2014 19:47:22 | |
---|---|---|---|
Problema | Sortare prin comparare | Scor | 60 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.39 kb |
#include <iostream>
#include <fstream>
#include <map>
#include <algorithm>
using namespace std;
ifstream f("algsort.in");
ofstream g("algsort.out");
multimap<int, int> mm;
int n,x;
int main(){
f>>n;
while(f>>x) mm.insert(pair<int, int> (x, x));
multimap<int, int>::iterator it;
it=mm.begin();
while(it!=mm.end())
g<<(*it++).first<<" ";
return 0;
}