Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- double c[n];
- for(int l=0; l<n; l++)
- cin >> c[l];
- for(int l=0; l<n-1; l++)
- for(int j=l+1; j<n; j++)
- if(c[j] > c[l])
- {
- double d=c[j];
- c[j]=c[l];
- c[l]=d;
- }
- for(int b=0; b<n; b++)
- cout << c[b] <<" ";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement