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 <cmath> #include <vector> using namespace std; float foo(int x, unsigned int y) { if (0==y) return x; float den = pow(10,-1 * floor(log10(y)+1)); return x + y * den; } int main() { vector<vector<int>> tests { {3,1234}, {1,1000}, {2,12}, {0,0}, {9,1} }; for(auto& test: tests) { cout << "Test: " << test[0] << "," << test[1] << ": " << foo(test[0],test[1]) << 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