Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace zadacha_6
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int a = 0;
- int b = 0;
- int c = 0;
- int d = 0;
- int count = 0;
- for (int num1 = a; num1 <= 9; num1++)
- {
- for (int num2 = 9; num2 <= a; num2++)
- {
- for (int num3 = 0; num3 <= 9; num3++)
- {
- for (int num4 = 9; num4 <= c; num4++)
- {
- if ((count = (a + b + c + d)) == (a * b * c * d) && n != 5)
- {
- Console.WriteLine($"{a}{b}{c}{d}");
- }
- else if ((a * b * c * d) / (a + b + c + d) == 3 && n != 3)
- {
- Console.WriteLine($"{d}{c}{b}{a}");
- }
- }
- if (count == n)
- {
- Console.WriteLine($"{n}");
- }
- else
- {
- Console.WriteLine($"Nothing found");
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement