Pagini recente » Cod sursa (job #1878149) | Cod sursa (job #1242972) | Cod sursa (job #335836) | Clasament hlo-2023-cls9-tema0 | Cod sursa (job #2025958)
#include <fstream>
#include <vector>
#include <algorithm>
#include <typeinfo>
using namespace std;
ifstream fin("algsort.in");
ofstream fout("algsort.out");
vector<long long> a;
int n;
int main()
{
fin>>n;
int x;
for(int i=1;i<=n;i++)
{fin>>x;
a.push_back(x);}
sort(a.begin(),a.end());
for(decltype(a.begin()) it=a.begin();it!=a.end();it++)
if(it==a.end()-1)
fout<<*it;
else
fout<<*it<<" ";
return 0;
}