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 TheSongOfThe
- {
- class TheSongOfThe
- {
- static void Main(string[] args)
- {
- int controlValue = int.Parse(Console.ReadLine());
- int password = 0;
- string pass = string.Empty;
- for (int a = 1; a <= 9; a++)
- {
- for (int b = 1; b <= 9; b++)
- {
- for (int c = 1; c <= 9; c++)
- {
- for (int d = 1; d <= 9; d++)
- {
- if (a < b && c > d && (a * b + c * d) == controlValue)
- {
- Console.Write($"{a}{b}{c}{d} ");
- password++;
- }
- if (password == 4)
- {
- pass = ($"{a}{b}{c}{d}");
- }
- }
- }
- }
- }
- Console.WriteLine();
- if (password < 4)
- {
- Console.WriteLine("No!");
- }
- else
- {
- Console.WriteLine($"Password: {pass}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment