Advertisement
ramsess

Special_number_V2

Mar 2nd, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1. using System;
  2.  
  3. class SpecialNumbers
  4. {
  5.     static void Main()
  6.     {
  7.         var n = int.Parse(Console.ReadLine());
  8.  
  9.         for (int a = 1; a < 10; a++)
  10.         {
  11.             for (int b = 1; b < 10; b++)
  12.             {
  13.                 for (int c = 1; c < 10; c++)
  14.                 {
  15.                     for (int d = 1; d < 10; d++)
  16.                     {
  17.                         if ((n % a == 0) && (n % b == 0) && (n % c == 0) && (n % d == 0))
  18.                         {
  19.                             Console.Write("{0}{1}{2}{3} ", a, b, c, d);
  20.                         }
  21.                     }
  22.                 }
  23.             }
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement