online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <sstream> #include <string> #include <algorithm> #include <cstdlib> std::string box(int n) { std::stringstream s; int m = n - 1; for (int y = -m; y <= m; ++y) { for (int x = -m; x <= m; ++x) { s << (std::max(std::abs(x),std::abs(y)) + 1) << ' '; } s << std::endl; } return s.str(); } int main() { std::cout << box(2); std::cout << box(5); 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