Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3.  
  4. using namespace std;
  5.  
  6. int a[] = {6,7, 3, 2, 1};
  7.  
  8. bool f(int i, int j) {
  9.     return i > j;
  10. }
  11.  
  12. int main()
  13. {
  14.  
  15.     sort(a, a+5, f);
  16.  
  17.     for (int i = 0; i < 5; i++)
  18.         cout << a[i] << endl;
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement