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 Special_Numbers
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int rest = 0;
- for (int i = 1111; i <= 9999; i++)
- {
- int k = i % 10;
- rest = i / 10;
- int m = rest % 10;
- rest = rest / 10;
- int l = rest % 10;
- rest = rest / 10;
- int o = rest % 10;
- if (o != 0 && l != 0 && m != 0 && k != 0)
- {
- if (n % o == 0 && n % l == 0 && n % m == 0 && n % k == 0)
- {
- Console.Write("{0}{1}{2}{3} ", o, l, m, k);
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement