Advertisement
Guest User

Untitled

a guest
May 19th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | None | 0 0
  1. using System;
  2.  
  3. class MagicLetter
  4. {
  5.     static void Main()
  6.     {
  7.         char first = char.Parse(Console.ReadLine().ToLower());
  8.         char second = char.Parse(Console.ReadLine().ToLower());
  9.         char third = char.Parse(Console.ReadLine().ToLower());
  10.  
  11.         for (char p1 = first; p1 <= second; p1++)
  12.         {
  13.             for (char p2 = first; p2 <= second; p2++)
  14.             {
  15.                 for (char p3 = first; p3 <= second; p3++)
  16.                 {
  17.                     if (p1 == third)
  18.                     {
  19.                         p1++;
  20.                     }
  21.                     else if (p2 == third)
  22.                     {
  23.                         p2++;
  24.                     }
  25.                     else if (p3 == third)
  26.                     {
  27.                         p3++;
  28.                     }
  29.                     Console.Write($"{p1}{p2}{p3} ");
  30.                 }
  31.             }
  32.         }
  33.         Console.WriteLine();
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement