Advertisement
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 _14_Magic_Letter
- {
- class Program
- {
- static void Main(string[] args)
- {
- char first = char.Parse(Console.ReadLine());
- char second = char.Parse(Console.ReadLine());
- char third = char.Parse(Console.ReadLine());
- char min = GetMin(first, second);
- char max = GetMax(first, second);
- StringBuilder Everything = new StringBuilder();
- for (char i = min; i <= max; i++)
- {
- for (char j = min; j <= max; j++)
- {
- for (char k = min; k <= max; k++)
- {
- if (i != third && j != third && k != third)
- {
- string iString = new string(i, 1);
- string jString = new string(j, 1);
- string kString = new string(k, 1);
- Everything.Append(iString + jString + kString + " ");
- }
- }
- }
- }
- string final = Everything.ToString();
- Console.WriteLine(final);
- }
- private static char GetMax(char first, char second)
- {
- char max = first;
- if (first < second)
- {
- max = second;
- }
- return max;
- }
- private static char GetMin(char first, char second)
- {
- char min = first;
- if (first > second)
- {
- min = second;
- }
- return min;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement