Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _06._Math_Puzzle
- {
- class Program
- {
- static void Main(string[] args)
- {
- int key = int.Parse(Console.ReadLine());
- for (int a = 1; a <= key; a++)
- {
- for (int b = 1; b <= key; b++)
- {
- for (int c = 1; c <= key; c++)
- {
- if (a<b&&b<c&&a+b+c==key)
- {
- Console.WriteLine($"{a} + {b} + {c} = {key}");
- }
- if (a>b&&b>c&&a*b*c==key)
- {
- Console.WriteLine($"{a} * {b} * {c} = {key}");
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement