Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace MagicCombination
- {
- class Program
- {
- public static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int multiply = 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++)
- {
- for(int e = 1; e <= 9; e++)
- {
- for(int f = 1; f <= 9; f++)
- {
- multiply = a * b * c * d * e * f;
- if(multiply == n)
- {
- string sequence = "" + a + b + c + d + e + f;
- Console.Write("{0} ", sequence);
- }
- }
- }
- }
- }
- }
- }
- Console.WriteLine();
- Console.Write("Press any key to continue . . . ");
- Console.ReadKey(true);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement