Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace TheSongOfTheWheels
- {
- class Program
- {
- static void Main(string[] args)
- {
- int number = int.Parse(Console.ReadLine());
- string print = "No!";
- int counter = 0;
- 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 == number && a < b && c > d )
- {
- Console.Write($"{a}{b}{c}{d} ");
- counter++;
- if (counter == 4)
- {
- print = $"Password: {a}{b}{c}{d}";
- }
- }
- }
- }
- }
- }
- Console.WriteLine($"\n{print}");
- }
- }
- }
Add Comment
Please, Sign In to add comment