fork(59) download
  1. #include <iostream>
  2. #include <algorithm>
  3.  
  4. template <typename T, size_t N> const T* mybegin(const T (&a)[N]) { return a; }
  5. template <typename T, size_t N> const T* myend (const T (&a)[N]) { return a+N; }
  6.  
  7. int main()
  8. {
  9. const int cloud[] = { 1,2,3,4,-7,999,5,6 };
  10.  
  11. std::cout << *std::max_element(mybegin(cloud), myend(cloud)) << '\n';
  12. std::cout << *std::min_element(mybegin(cloud), myend(cloud)) << '\n';
  13. }
  14.  
Success #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
999
-7