Advertisement
vencinachev

MagicNum

Nov 28th, 2021
716
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 Loops
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int num = int.Parse(Console.ReadLine());
  10.             for (int a = 0; a <= 9; a++)
  11.             {
  12.                 for (int b = 0; b <= 9; b++)
  13.                 {
  14.                     for (int c = 0; c <= 9; c++)
  15.                     {
  16.                         for (int d = 0; d <= 9; d++)
  17.                         {
  18.                             for (int e = 0; e <= 9; e++)
  19.                             {
  20.                                 for (int f = 0; f <= 9; f++)
  21.                                 {
  22.                                     if (a*b*c*d*e*f == num)
  23.                                     {
  24.                                         Console.Write($"{a}{b}{c}{d}{e}{f} ");
  25.                                     }
  26.                                 }
  27.                             }
  28.                         }
  29.                     }
  30.                 }
  31.             }
  32.             //Console.WriteLine();
  33.         }
  34.     }
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement