Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- unsigned n,i,v[1000],cif[1000],aux,j;
- cout<<"n=";cin>>n;
- for (i=0;i<n;i++)
- cin>>v[i];
- for (i=0;i<n;i++)
- {
- while (v[i]>10)
- v[i]/=10;
- cif[i]=v[i];
- }
- for (i=0;i<n-1;i++)
- for (j=i+1;j<n;j++)
- if (cif[i]>cif[j])
- {
- aux=cif[i];
- cif[i]=cif[j];
- cif[j]=aux;
- }
- for (i=0;i<n;i++)
- cout<<cif[i];
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement