|
Radbug
SUPREME DRINKER

| Joined: 16 Oct 2009 |
| Posts: 17 |
|
|
 |
#include <fstream.h>
#include <iostream.h>
unsigned long ni,uc,x,gasit,n;
int main()
{
ifstream fin("comoara.in");
ofstream fout("comoara.out");
cin>>n;
x=n;
ni=0;
while (x>0)
{
ni=ni*10+x%10;
x=x/10;
}
gasit=0;
while(ni>0)
{
uc=ni%10;
ni=ni/10;
if (uc<ni%10)
gasit=1;
else
x=x*10+uc;
}
if (gasit==0)
{
x=x/10;
cout<<x;
fin.close();
fout.close();
}
}
|
|
|
|