Advertisement
knikolov98

Untitled

Oct 15th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 KB | None | 0 0
  1. using System;
  2.  
  3. using System.Collections.Generic;
  4.  
  5. using System.Linq;
  6.  
  7. using System.Text;
  8.  
  9. using System.Threading.Tasks;
  10.  
  11.  
  12.  
  13. namespace SpecialNumbers
  14.  
  15. {
  16.  
  17.     class SpecialNumbers
  18.  
  19.     {
  20.  
  21.         static void Main(string[] args)
  22.  
  23.         {
  24.  
  25.             int n = int.Parse(Console.ReadLine());
  26.  
  27.  
  28.  
  29.             for (int i = 1; i <= 9; i++)
  30.  
  31.             {
  32.  
  33.                 for (int j = 1; j <= 9; j++)
  34.  
  35.                 {
  36.  
  37.                     for (int m = 1; m <= 9; m++)
  38.  
  39.                     {
  40.  
  41.                         for (int k = 1; k <= 9; k++)
  42.  
  43.                         {
  44.  
  45.                             if (n % i == 0 && n % j == 0 && n % m == 0 && n % k == 0)
  46.  
  47.                             {
  48.  
  49.                                 Console.Write("{0}{1}{2}{3} ", i, j, m, k);  
  50.  
  51.                             }
  52.  
  53.                         }
  54.  
  55.                     }
  56.  
  57.                 }
  58.  
  59.             }
  60.  
  61.         }
  62.  
  63.     }
  64.  
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement