SHARE
TWEET

Untitled

a guest Mar 25th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {int i,n,v[100],j,aux;
  7. cin>>n;
  8.  for (i=1;i<=n;i++)
  9.  {
  10.      cin>>v[i];
  11.  }
  12.  for(i=1;i<n;i++)
  13.     for(j=i+1;j<=n;j++)
  14.  if(v[i]<v[j]){
  15.     aux=v[i];
  16.     v[i]=v[j];
  17.     v[j]=aux;
  18.  }
  19.  for(i=1; i<=n;i++)
  20.     cout<<v[i]<<" ";
  21.  
  22.     return 0;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top