Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Fishland
- {
- class Program
- {
- static void Main(string[] args)
- {
- var input = int.Parse(Console.ReadLine());
- var cnt = 0;
- for (int i = 1; i <= 30; i++)
- {
- for (int g = 1; g <= 30; g++)
- {
- for (int j = 1; j <= 30; j++)
- {
- if (j + g + i == input && i < g && g < j)
- {
- cnt++;
- Console.WriteLine($"{i} + {g} + {j} = {input}");
- }
- else if (j * g * i == input && i > g && g > j)
- {
- cnt++;
- Console.WriteLine($"{i} * {g} * {j} = {input}");
- }
- }
- }
- }
- if (cnt == 0)
- {
- Console.WriteLine("No!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement