online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #include <iostream> #include <algorithm> #include <vector> using namespace std; auto absolute = [](auto& x)->float{ return x<0?-x:x;}; int main() { auto absoluteLess = [&](auto&x, auto&y)->bool{ return absolute(x)>absolute(y);}; auto absoluteGreater = [&](auto&x, auto&y)->bool{ return absolute(x)<absolute(y);}; std::vector<float> input={-2.0, 0.0, 3.4, -123.0}; std::cout << *std::max_element(input.begin(), input.end(), absoluteLess) <<std::endl; std::cout << *std::max_element(input.begin(), input.end(), absoluteGreater) <<std::endl; return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue