Advertisement
Spocoman

Letters Combinations

Feb 24th, 2022
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 KB | None | 0 0
  1. using System;
  2.  
  3. namespace LettersCombination
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             char x = char.Parse(Console.ReadLine());
  10.             char y = char.Parse(Console.ReadLine());
  11.             char z = char.Parse(Console.ReadLine());
  12.            
  13.             int counter = 0;
  14.  
  15.             for (int i = x; i <= y; i++)
  16.             {
  17.                 for (int k = x; k <= y; k++)
  18.                 {
  19.                     for (int j = x; j <= y; j++)
  20.                     {
  21.                         if (i != z && k != z && j != z)
  22.                         {
  23.                             Console.Write($"{(char)i}{(char)k}{(char)j} ");
  24.                             counter++;
  25.                         }
  26.                     }
  27.                 }
  28.             }
  29.             Console.WriteLine(counter);
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement