Pagini recente » Cod sursa (job #1140452) | Cod sursa (job #2618144) | Cod sursa (job #1900042) | Cod sursa (job #1833293) | Cod sursa (job #2281795)
#include <bits/stdc++.h>
using namespace std;
vector<int> v;
struct reader
{
char buff[32010];
int poz;
reader()
{
freopen("algsort.in","r",stdin);
freopen("algsort.out","w",stdout);
poz=31999;
inc();
}
void operator>>(int &x)
{
while(buff[poz]<'0'||buff[poz]>'9')
inc();
x=0;
while(buff[poz]>='0'&&buff[poz]<='9')
{
x=10*x+buff[poz]-'0';
inc();
}
}
void operator>>(vector<int> &v)
{
int n,x;
*this >> n;
v.resize(0);
for(;n;n--)
{
*this >> x;
v.push_back(x);
}
sort(v.begin(),v.end());
for(auto it:v)
printf("%d ",it);
}
void inc()
{
poz++;
if(poz==32000)
{
fread(buff,1,32000,stdin);
poz=0;
}
}
};
int main(){
reader f;
f>>v;
return 0;
}