SHARE
TWEET

codeforce - different row

jakaria_hossain Jun 27th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
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