Advertisement
Guest User

Untitled

a guest
Dec 12th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.16 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 _09.Magic_Numbers
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int magic = int.Parse(Console.ReadLine());
  14.             for (int x1 = 0; x1 < 10; x1++)
  15.             {
  16.                 for (int x2 = 0; x2 < 10; x2++)
  17.                 {
  18.                     for (int x3 = 0; x3 < 10; x3++)
  19.                     {
  20.                         for (int x4 = 0; x4 < 10; x4++)
  21.                         {
  22.                             for (int x5 = 0; x5 < 10; x5++)
  23.                             {
  24.                                 for (int x6 = 0; x6 < 10; x6++)
  25.                                 {
  26.                                     if ((x1 * x2 * x3 * x4 * x5 * x6) == magic)
  27.                                     {
  28.                                         Console.Write($"{x1}{x2}{x3}{x4}{x5}{x6} "); ;
  29.                                     }
  30.                                 }
  31.                             }
  32.                         }
  33.                     }
  34.                 }
  35.             }
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement