193030

1.6

May 8th, 2021
584
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <algorithm>
  2. #include <iostream>
  3. //#include <bits/stdc++.h>
  4. #define endl '\n'
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     /*ios_base::sync_with_stdio(false);
  10.     cin.tie(0);*/
  11.     int arr[10] = {11,2,3,4,5,6,7,9,101,11};
  12.     int arraySize = (sizeof(arr) / sizeof(arr[0]));
  13.     //fill_n(arr, 10, 1);7
  14.     sort(arr, arr + arraySize);
  15.     for (int i = 0; i < arraySize; i++)
  16.     {
  17.         cout << arr[i] << endl;
  18.     }
  19.     //cout << min_element(*arr, 2) << endl;
  20.     reverse(arr, arr + arraySize);
  21.     for (int i = 0; i < arraySize; i++)
  22.     {
  23.         cout << arr[i] << endl;
  24.     }
  25. }
RAW Paste Data