Advertisement
Dianov

Data Types and Variables - Exercise (06. Triples of Latin Letters)

Aug 7th, 2021
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1. using System;
  2.  
  3. namespace TriplesOfLatinLetters
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int numberOfLetters = int.Parse(Console.ReadLine());
  10.  
  11.             for (int i = 0; i < numberOfLetters; i++)
  12.             {
  13.                 char firstChar = (char)('a' + i);
  14.                 for (int j = 0; j < numberOfLetters; j++)
  15.                 {
  16.                     char secondChar = (char)('a' + j);
  17.                     for (int k = 0; k < numberOfLetters; k++)
  18.                     {
  19.                         char thirdChar = (char)('a' + k);
  20.                         Console.WriteLine($"{firstChar}{secondChar}{thirdChar}");
  21.                     }
  22.                 }
  23.             }
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement