Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace LettersCombination
- {
- class Program
- {
- static void Main(string[] args)
- {
- var start = char.Parse(Console.ReadLine());
- var end = Console.ReadLine()[0];
- var ignorChar = char.Parse(Console.ReadLine());
- var combinations = 0;
- for (int i = start; i <= end; i++) //отпечатваме 1-вата буква
- {
- for (int j = start; j <= end; j++) // отпечатваме 2-та буква
- {
- for (int k = start; k <= end; k++) // за 3-тата буква
- {
- if (i != ignorChar && j != ignorChar && k != ignorChar)
- {
- Console.Write("{0}{1}{2} ", (char)i, (char)j, (char)k);
- combinations++;
- }
- }
- }
- }
- Console.WriteLine(combinations);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment