grach

2016_April_24 Special Numbers

Aug 13th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 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 SpecialNumbers
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {          
  13.             var n = int.Parse(Console.ReadLine());
  14.  
  15.             for (int a = 1; a < 10; a++)
  16.             {
  17.                 for (int b = 1; b < 10; b++)
  18.                 {
  19.                     for (int c = 1; c < 10; c++)
  20.                     {
  21.                         for (int d = 1; d < 10; d++)
  22.                         {
  23.                             if ((n % a == 0) && (n % b == 0) && (n % c == 0) && (n % d == 0))
  24.                             {
  25.                                 Console.Write("{0}{1}{2}{3} ", a, b, c, d);
  26.                             }
  27.                         }
  28.                     }
  29.                 }
  30.             }
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment