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> bool red(int x, int y, int m =10, int k =0){ return x==k; } bool blue(int x, int y, int m =10, int k =0){ bool dziedzina = x>k and x < (m+k)/2 +1; return y==-(x-k)+m and dziedzina; } bool green(int x, int y, int m =10, int k =0){ bool dziedzina = x>(m+k)/2 and x < (m+k); return y==(x) and dziedzina; } bool purple(int x, int y, int m =10, int k =0){ return x==m; } int main(){ int n=17; int k=5, count=n+k,m=count-1; char ch='W', bg='.'; for (size_t y = 0; y < count; y++) { for (size_t x = 0; x < count; x++) { if (red(x,y,m,k)||blue(x,y,m,k)||green(x,y,m,k)||purple(x,y,m,k)) { std::cout<<ch; } else std::cout<<bg; } std::cout<<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