madeofglass

Untitled

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