Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n,i,j,k,arr[10000],temp,number;
- cin>>n;
- for(i = 0; i<n; i++)
- {
- cin>>arr[i];
- }
- for(i = 0; i<n ; i++)
- {
- for(j=i; j<n; j++ )
- {
- if(arr[i]<arr[j])
- {
- temp = arr[i];
- cout<<arr[i]<<endl;
- arr[i] = arr[j];
- cout<<arr[i]<<endl;
- arr[j] = temp;
- cout<<arr[j]<<endl;
- }
- }
- }
- number = 0;
- for(j = 0; j<n; j++)
- {
- number = number *10 + arr[j];
- }
- cout<<number<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement