online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
using System; namespace ConsoleApp15 { internal class Program { static void Main(string[] args) { // https://onlinegdb.com/L_8sn50ay Console.Write("\n "); int a = int.Parse(Console.ReadLine()); int[,] vs = new int[a, a]; Console.WriteLine(); for (int i = 0; i < a; i++) { Console.Write(" "); for (int j = 0; j < a; j++) { if (i == j) { vs[i, j] = 1; if (i == ((a - 1) / 2) && i > 0 && a % 2 != 0) vs[i, j] = 8; // sam środek gdy liczba wierszy nieparzysta } //else if (i == ((a - 1) - j)) else if (i + j == a - 1) vs[i, j] = 1; else vs[i, j] = 0; WriteInColor(vs[i, j]); } Console.WriteLine(); } } static void WriteInColor(int value, string color = "White") { switch (value) { case 1: color = "Cyan"; break; case 8: color = "Yellow"; break; } Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), color); Console.Write(value); Console.ResetColor(); } } }

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