krasi1105

Letters-Combinations

Mar 4th, 2017
701
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.20 KB | None | 0 0
  1. using System;
  2. namespace _06.Letters_Combinations
  3. {
  4.     class Program
  5.     {
  6.         static void Main()
  7.         {
  8.             int a = char.Parse(Console.ReadLine().ToLower());
  9.             int b = char.Parse(Console.ReadLine().ToLower());
  10.             int c = char.Parse(Console.ReadLine().ToLower());
  11.             int count = 0;
  12.             for (int i = a; i <= b; i++)
  13.             {
  14.                 if (i == c)
  15.                 {
  16.                     //i++;
  17.                     continue;
  18.                 }
  19.                 for (int j = a; j <= b; j++)
  20.                 {
  21.                     if (j == c)
  22.                     {
  23.                         //j++;
  24.                         continue;
  25.                     }
  26.                     for (int l = a; l <= b; l++)
  27.                     {
  28.                         if (l == c)
  29.                         {
  30.                             //l++;
  31.                             continue;
  32.                         }
  33.                         count++;
  34.                         Console.Write("{0}{1}{2} ", (char)(i), (char)(j), (char)(l));
  35.                     }                  
  36.                 }
  37.             }
  38.             Console.WriteLine(count);
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment