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 < 10000; i++)
- //for (int i = 1111; i <= 9999; i++)
- {
- int a = i % 10;
- rest = i / 10;
- int b = rest % 10;
- rest = rest / 10;
- int c = rest % 10;
- rest = rest / 10;
- int d = rest % 10;
- if (a != 0 && b != 0 && c != 0 && d != 0)
- {
- if (n % a == 0 && n % b == 0 && n % c == 0 && n % d == 0)
- {
- Console.Write("{0}{1}{2}{3} ", a, b, c, d);
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement