fbinnzhivko

06.00 Магически числа

May 3rd, 2016
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         int n = int.Parse(Console.ReadLine());
  7.  
  8.         for (int x1 = 0; x1 <= 9; x1++)
  9.         {
  10.             for (int x2 = 0; x2 <= 9; x2++)
  11.             {
  12.                 for (int x3 = 0; x3 <= 9; x3++)
  13.                 {
  14.                     for (int x4 = 0; x4 <= 9; x4++)
  15.                     {
  16.                         for (int x5 = 0; x5 <= 9; x5++)
  17.                         {
  18.                             for (int x6 = 0; x6 <= 9; x6++)
  19.                             {
  20.                                 if (x1 * x2 * x3 * x4 * x5 * x6 == n)
  21.                                 {
  22.                                     Console.Write("{0}{1}{2}{3}{4}{5} ", x1, x2, x3, x4, x5, x6);
  23.                                 }
  24.                             }
  25.                         }
  26.                     }
  27.                 }
  28.             }
  29.         }
  30.     }
  31. }
Add Comment
Please, Sign In to add comment