Cod sursa(job #2840848)
| Utilizator | Data | 28 ianuarie 2022 20:37:42 | |
|---|---|---|---|
| Problema | Sortare prin comparare | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.44 kb |
#include <fstream>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const string name = ("algsort");
ifstream fin(name + ".in");
ofstream fout(name + ".out");
vector <int> v;
int n;
void rezolvare()
{
fin >> n;
for (int i = 0; i < n; i++) {
int x;
fin >> x;
v.push_back(x);
}
sort(v.begin(), v.end());
for (auto x : v)
fout << x << ' ';
}
int main()
{
rezolvare();
}