Rezolvare :
#include < iostream.h >
#include < fstream.h >
int main()
{int nr,x,y,max,min;
min=9;
max=0;
y=0;
x=nr;
ifstream a("date.int");
a>> nr;
while(x!=0)
{if(x%10>max)
max=x%10;
if(x%10
x=x/10;
}
x=nr;
while(x!=0)
{if(x%10!=min&&x%10!=max)
y=y*10+x%10;
x=x/10;
}
while(y!=0)
{x=x*10+y%10;
y=y/10;
}
a.close();
cout << "x=" << x;
return 0;
}
Niciun comentariu:
Trimiteți un comentariu