DidiMilikina

Letters Combinations

Apr 25th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.21 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 Problem_06.Letters_Combinations
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int a = char.Parse(Console.ReadLine().ToLower());
  14.             int b = char.Parse(Console.ReadLine().ToLower());
  15.             int c = char.Parse(Console.ReadLine().ToLower());
  16.             int count = 0;
  17.  
  18.             for (int i = a; i <= b; i++)
  19.             {
  20.                 if (i == c)
  21.                 {
  22.                     continue;
  23.                 }
  24.                 for (int j = a; j <= b; j++)
  25.                 {
  26.                     if (j == c)
  27.                     {
  28.                         continue;
  29.                     }
  30.                     for (int l = a; l <= b; l++)
  31.                     {
  32.                         if (l == c)
  33.                         {
  34.                             continue;
  35.                         }
  36.                         count++;
  37.                         Console.Write("{0}{1}{2} ", (char)(i), (char)(j), (char)(l));
  38.                     }
  39.                 }
  40.             }
  41.             Console.WriteLine(count);
  42.         }
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment