fork download
  1. #include <algorithm>
  2. #include <tuple>
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int x[] = { 10, 20 }, y[] = { 132, 12 }, *minx, *miny, *maxx, *maxy;
  10.  
  11. tie(minx, maxx) = minmax_element(begin(x), end(x));
  12. tie(miny, maxy) = minmax_element(begin(y), end(y));
  13.  
  14. cout<<"minx="<<*minx<<"\n";
  15. cout<<"maxx="<<*maxx<<"\n";
  16. cout<<"miny="<<*miny<<"\n";
  17. cout<<"maxy="<<*maxy<<"\n";
  18. }
Success #stdin #stdout 0s 2896KB
stdin
Standard input is empty
stdout
minx=10
maxx=20
miny=12
maxy=132