Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Купа
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- for (int one = 1; one <= 9; one++)
- {
- for (int two = 1; two <= 9; two++)
- {
- for (int three = 1; three <= 9; three++)
- {
- for (int four = 1; four <= 9; four++)
- {
- if (n % one == 0 &&
- n % two == 0 &&
- n % three == 0 &&
- n % four == 0)
- {
- Console.Write($"{one}{two}{three}{four} ");
- }
- }
- }
- }
- }
- }
- }
- }
- // Специални числа
- // Пример 3
- // 1111 1113 1131 1133 1311
- // 1313 1331 1333 3111 3113
- // 3131 3133 3311 3313 3331
- // 3333
Advertisement
Add Comment
Please, Sign In to add comment