fbinnzhivko

Problem 06. Letters Combinations

Dec 21st, 2016
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.08 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.Remoting.Channels;
  5.  
  6. namespace ConsoleApplication
  7. {
  8.     internal class Program
  9.     {
  10.         public static void Main(string[] args)
  11.         {
  12.             char first = char.Parse(Console.ReadLine());
  13.             char second = char.Parse(Console.ReadLine());
  14.             char third = char.Parse(Console.ReadLine());
  15.  
  16.             int cpunter = 0;
  17.             string print = "";
  18.  
  19.             for (var x = first; x <= (int) second; x++)
  20.             {
  21.                 for (var y = first; y <= (int) second; y++)
  22.                 {
  23.                     for (var z = first; z <= (int) second; z++)
  24.                     {
  25.                         print = x.ToString() + y + z;
  26.  
  27.                         if (print.Contains(third) == false)
  28.                         {
  29.                             cpunter++;
  30.                             Console.Write(print+" ");
  31.                         }
  32.                     }
  33.                 }
  34.             }
  35.             Console.Write("{0}",cpunter);
  36.         }
  37.     }
  38. }
Add Comment
Please, Sign In to add comment