Advertisement
vencinachev

NMod

Nov 28th, 2021
871
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.78 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 n = int.Parse(Console.ReadLine());
  10.             for (int a = 1; a <= 9; a++)
  11.             {
  12.                 for (int b = 1; b <= 9; b++)
  13.                 {
  14.                     for (int c = 1; c <= 9; c++)
  15.                     {
  16.                         for (int d = 1; d <= 9; d++)
  17.                         {
  18.                             if (n % a == 0 && n % b == 0 && n % c == 0 && n % d == 0)
  19.                             {
  20.                                 Console.Write($"{a}{b}{c}{d} ");
  21.                             }
  22.                         }
  23.                     }
  24.                 }
  25.             }
  26.             Console.WriteLine();
  27.         }
  28.     }
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement