Files
  • main.cs
  • main.exe
main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System;

class TriangleOfLetters {
    static void PrintLetter(char letter, int count)
    {
        for (int i = 0; i < count; i++)
            Console.Write(letter + " ");
        Console.WriteLine();
    }

    static void Main()
    {
        int count = 0;
        for (char letter = 'a'; letter <= 'd'; letter++)
            PrintLetter(letter, ++count);
        for (char letter = 'c'; letter >= 'a'; letter--)
            PrintLetter(letter, --count);
    }
}