Advertisement
Guest User

Untitled

a guest
Dec 18th, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.14 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 _06_Problem
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             char  first = char.Parse(Console.ReadLine());
  14.             char second = char.Parse(Console.ReadLine());
  15.             char stop = char.Parse(Console.ReadLine());
  16.             int count = 0;
  17.             for (char a = first; a <= second; a++)
  18.             {
  19.                 for (char b = first; b <= second; b++)
  20.                 {
  21.                     for (char c = first; c <= second; c++)
  22.                     {
  23.                         if (a == stop || b == stop || c == stop)
  24.                         {
  25.                           // do nothing
  26.                         }
  27.                         else
  28.                         {
  29.                             // print all kombinations without c
  30.                             Console.Write("{0}{1}{2} ", a, b, c);
  31.                             count++;
  32.                         }
  33.                     }
  34.                 }
  35.             }
  36.             Console.Write(count);
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement