using System;
class GFG {
static void print( int [,]mat)
{
for ( int i = 0; i < 5; i++) {
for ( int j = 0; j < 5; j++) {
if (i % 2 == 0) {
if (mat[i,j] == 1)
Console.Write( "-" );
else
Console.Write( " " );
}
else {
if (mat[i,j] == 1)
Console.Write( "|" );
else
Console.Write( " " );
}
}
Console.WriteLine();
}
}
static void digit0()
{
int [ ,]mat = { { 0, 1, 0, 1, 0 },
{ 1, 0, 0, 0, 1 },
{ 0, 0, 0, 0, 0 },
{ 1, 0, 0, 0, 1 },
{ 0, 1, 0, 1, 0 } };
print(mat);
}
static void digit1()
{
int [ ,]mat = { { 0, 0, 0, 0, 0 },
{ 0, 0, 1, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 1, 0, 0 },
{ 0, 0, 0, 0, 0 } };
print(mat);
}
static void digit2()
{
int [ ,]mat = { { 0, 1, 0, 1, 0 },
{ 0, 0, 0, 0, 1 },
{ 0, 1, 0, 1, 0 },
{ 1, 0, 0, 0, 0 },
{ 0, 1, 0, 1, 0 } };
print(mat);
}
static void digit3()
{
int [ ,]mat = { { 0, 1, 0, 1, 0 },
{ 0, 0, 0, 0, 1 },
{ 0, 1, 0, 1, 0 },
{ 0, 0, 0, 0, 1 },
{ 0, 1, 0, 1, 0 } };
print(mat);
}
static void digit4()
{
int [ ,]mat = { { 0, 0, 0, 0, 0 },
{ 1, 0, 0, 0, 1 },
{ 0, 1, 0, 1, 0 },
{ 0, 0, 0, 0, 1 },
{ 0, 0, 0, 0, 0 } };
print(mat);
}
static void digit5()
{
int [ ,]mat = { { 0, 1, 0, 1, 0 },
{ 1, 0, 0, 0, 0 },
{ 0, 1, 0, 1, 0 },
{ 0, 0, 0, 0, 1 },
{ 0, 1, 0, 1, 0 } };
print(mat);
}
static void digit6()
{
int [ ,]mat = { { 0, 1, 0, 1, 0 },
{ 1, 0, 0, 0, 0 },
{ 0, 1, 0, 1, 0 },
{ 1, 0, 0, 0, 1 },
{ 0, 1, 0, 1, 0 } };
print(mat);
}
static void digit7()
{
int [ ,]mat = { { 0, 1, 0, 1, 0 },
{ 0, 0, 0, 0, 1 },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 1 },
{ 0, 0, 0, 0, 0 } };
print(mat);
}
static void digit8()
{
int [ ,]mat = { { 0, 1, 0, 1, 0 },
{ 1, 0, 0, 0, 1 },
{ 0, 1, 0, 1, 0 },
{ 1, 0, 0, 0, 1 },
{ 0, 1, 0, 1, 0 } };
print(mat);
}
static void digit9()
{
int [ ,]mat = { { 0, 1, 0, 1, 0 },
{ 1, 0, 0, 0, 1 },
{ 0, 1, 0, 1, 0 },
{ 0, 0, 0, 0, 1 },
{ 0, 1, 0, 1, 0 } };
print(mat);
}
static void checkDigit( int num)
{
if (num == 0)
digit0();
else if (num == 1)
digit1();
else if (num == 2)
digit2();
else if (num == 3)
digit3();
else if (num == 4)
digit4();
else if (num == 5)
digit5();
else if (num == 6)
digit6();
else if (num == 7)
digit7();
else if (num == 8)
digit8();
else if (num == 9)
digit9();
}
public static void Main ()
{
int num = 9;
checkDigit(num);
}
}
|