Advertisement
rado8506

06. Magical numbers

Feb 20th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.11 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp36
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.  
  15.             for (int i = 1; i <= 9; i++)
  16.             {
  17.                 for (int j = 1; j <= 9; j++)
  18.                 {
  19.                     for (int k = 1; k <= 9; k++)
  20.                     {
  21.                         for (int l = 1; l <= 9; l++)
  22.                         {
  23.                             for (int m = 1; m <= 9; m++)
  24.                             {
  25.                                 for (int o = 1; o <= 9; o++)
  26.                                 {
  27.                                     if (i*j*k*l*m*o == n)
  28.                                     {
  29.                                         Console.Write($"{i}{j}{k}{l}{m}{o} ");
  30.                                     }
  31.                                 }
  32.                             }
  33.                         }
  34.                     }
  35.                 }
  36.             }
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement