Advertisement
jakaria_hossain

codeforce - different row

Jun 27th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <cmath>
  4. using namespace std;
  5. main()
  6. {
  7. ios::sync_with_stdio(0);
  8. int n,t[101];
  9. cin>>n;
  10.  
  11. for(int i=0; i<n; ++i)
  12. cin>>t[i];
  13. sort(t,t+n);
  14. cout<<t[n-1];
  15. for(int i=1; i<n-1; ++i)
  16. cout<<" "<<t[i];
  17. cout<<" "<<t[0]<<endl;
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement