Advertisement
vencinachev

Digits2

Nov 21st, 2021
1,011
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 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 ((a + b == c + d) && (n % (a + b) == 0))
  19.                             {
  20.                                 Console.Write($"{a}{b}{c}{d} ");
  21.                             }
  22.                         }
  23.                     }
  24.                 }
  25.             }
  26.         }
  27.     }
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement