Advertisement
rengetsu

NF_Algorithm

Oct 17th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. // Kak rabotaet sort() ?
  2. #include <iostream>
  3. #include <algorithm>
  4. using namespace std;
  5. int main()
  6. {
  7.     int n, nn[100];
  8.     cin >> n;
  9.     for(int i=0;i<n;i++)
  10.     {
  11.         cin >> nn[i];
  12.     }
  13.     cout << nn[0] << " " << nn[1] << " " << nn[2] << " " << nn[3] << " " << nn[4] << endl;
  14.     sort(nn, nn +n);
  15.     cout << nn[0] << " " << nn[1] << " " << nn[2] << " " << nn[3] << " " << nn[4] << endl;
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement