Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
C++
SUBMITTED BY:
sandub69
DATE:
June 19, 2019, 10:45 p.m.
FORMAT:
Text only
SIZE:
391 Bytes
Raw
Download
Tweet
HITS:
1777
Go to comments
Report
#include<iostream.h>
#include<math.h>
int main(){
int n,mic=0,mare=0,c[4],i,cif=1,aux,sortat;
cout<<"n=";cin>>n;
while(n!=0){
c[cif]=n%10;
n=n/10;
cif++;
}
do{
sortat=1;
for(i=1;i<4;i++)
if(c[i]>c[i+1]){
sortat=0;
aux=c[i];
c[i]=c[i+1];
c[i+1]=aux;
}
}while(!sortat);
for(i=1;i<=4;i++){
mare=pow(10,4-i)*c[5-i]+mare;
}
cout<<"mare este:"<<mare<<endl;
return 0;
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus