Pagini recente » Cod sursa (job #429571) | Cod sursa (job #1051001) | Cod sursa (job #862191) | Cod sursa (job #1920605) | Cod sursa (job #1843733)
#include <bits/stdc++.h>
using namespace std;
//ifstream f("elmaj.in");
//ifstream h("elmaj.in");
ofstream g("algsort.out");
int n,i,poz,x[500010];
char buff[10100];
const int DIM=10000;
inline void citeste(int &);
int main()
{
freopen("algsort.in","rb",stdin);
citeste(n);
for(i=1;i<=n;i++)
citeste(x[i]);
sort(x+1,x+n+1);
for(i=1;i<=n;i++)
g<<x[i]<<' ';
return 0;
}
inline void citeste(int &numar)
{
numar = 0;
while (buff[poz] < '0' || buff[poz] > '9')
if (++poz == DIM)
fread(buff,1,DIM,stdin),poz=0;
while ('0'<=buff[poz] && buff[poz]<='9')
{
numar = numar*10 + buff[poz] - '0';
if (++poz == DIM)
fread(buff,1,DIM,stdin),poz=0;
}
}