MiroslavKisov

Letters_Combinations

Aug 3rd, 2017
467
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.27 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Letters_Combinations
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             char letterStart = char.Parse(Console.ReadLine());
  14.             char letterEnd = char.Parse(Console.ReadLine());
  15.             char letterMiss = char.Parse(Console.ReadLine());
  16.             int printCount = 0;
  17.             for (char i = letterStart; i <= letterEnd; i++)
  18.             {
  19.                 if (i == letterMiss)
  20.                 {
  21.                     continue;
  22.                 }
  23.                 for (char j = letterStart; j <= letterEnd; j++)
  24.                 {
  25.                     if (j == letterMiss)
  26.                     {
  27.                         continue;
  28.                     }
  29.                     for (char k = letterStart; k <= letterEnd; k++)
  30.                     {
  31.                         if (k == letterMiss)
  32.                         {
  33.                             continue;
  34.                         }
  35.                         Console.Write("{0}{1}{2} ", i, j, k);
  36.                         printCount++;
  37.                     }
  38.                 }
  39.             }
  40.             Console.Write(printCount);
  41.         }
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment