Advertisement
kera123

Special Numbers

Dec 15th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1. using System;
  2.                    
  3. public class Program
  4. {
  5.     public static void Main()
  6.     {
  7.         int n = int.Parse(Console.ReadLine());
  8.                
  9.         for(int i = 1; i <= 9; i ++)
  10.         {
  11.             for(int j = 1; j <= 9; j ++)
  12.             {
  13.                 for(int k = 1; k <= 9; k ++)
  14.                 {
  15.                     for(int m = 1; m <= 9; m ++)
  16.                     {
  17.                         if (n % i == 0 && n % j == 0 && n % k == 0 && n % m == 0)
  18.                         {
  19.                             Console.Write("{0}{1}{2}{3}" + " ", i, j, k, m);
  20.                         }
  21.                     }
  22.                 }
  23.             }
  24.         }
  25.        
  26.        
  27.     }
  28.    
  29.    
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement