Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _03.SpecialNumbers
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- for (int firstNum = 1; firstNum <= 9; firstNum++)
- {
- for (int secondNum = 1; secondNum <= 9; secondNum++)
- {
- for (int thirdNum = 1; thirdNum <= 9; thirdNum++)
- {
- for (int fourthNum = 1; fourthNum <= 9; fourthNum++)
- {
- if (n % firstNum == 0 && n % secondNum == 0 && n % thirdNum == 0 && n % fourthNum == 0)
- {
- Console.Write("{0}{1}{2}{3} ", firstNum, secondNum, thirdNum, fourthNum);
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement