anizko

09. Magic Numbers (not included in final score)

Apr 17th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.03 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Magic_Numbers
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.  
  11.             for (int a=1;a<=9;a++)
  12.             {
  13.                 for (int b = 1; b <= 9; b++)
  14.                 {
  15.                     for (int c = 1; c <= 9; c++)
  16.                     {
  17.                         for (int d = 1; d <= 9; d++)
  18.                         {
  19.                             for (int e = 1; e <= 9; e++)
  20.                             {
  21.                                 for (int f = 1; f <= 9; f++)
  22.                                 {
  23.                                     if (a * b * c * d * e * f == n)
  24.                                     {
  25.                                         Console.Write($"{a}{b}{c}{d}{e}{f} ");
  26.  
  27.                                     }
  28.                                 }
  29.                             }
  30.                         }
  31.                     }
  32.                 }
  33.             }
  34.  
  35.          
  36.  
  37.  
  38.  
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment