Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Special_number
- {
- class MainClass
- {
- public static void Main (string[] args)
- {
- var n = int.Parse (Console.ReadLine ());
- int a = 0;
- int b = 0;
- int c = 0;
- int d = 0;
- for (int i = 1111; i < 9999; i++) {
- a = (i % 10);
- b = (i / 10 % 10);
- c = (i / 100 % 10);
- d = (i / 1000 % 10);
- if ((a != 0) && (n % a == 0)) {
- if ((b != 0) && (n % b == 0)) {
- if ((c != 0) && (n % c == 0)) {
- if ((d != 0) && (n % d == 0)) {
- Console.Write ("{0} ", i);
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement