Forum Index



Reply to topic
Comoara - clasa
Radbug
SUPREME DRINKER
SUPREME DRINKER
Radbug
Joined: 16 Oct 2009
Posts: 17
Reply with quote
Code:
#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();
}
}

View user's profileSend private message
Comoara - clasa
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT + 2 Hours  
Page 1 of 1  

  
  
 Reply to topic