| Varianta 16 / Subiectul 3 / Problema 4 |
#include <iostream.h>
#include <fstream.h>
long int b[10];
int i, c, x;
int main()
{
ifstream fin("numere.txt");
i = 0;
while( fin >> x )
while( x )
{
b[x % 10]++;
x = x / 10;
}
c = 9;
while( c >= 0)
{
for( int k = 1; k <=b[c]; k++)
cout << c;
c--;
}
cout << endl;
fin.close();
system("pause");
return 0;
}
|