Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 4396 / 157 = 28
- 5346 / 198 = 27
- 5346 / 297 = 18
- 5796 / 138 = 42
- 5796 / 483 = 12
- 7254 / 186 = 39
- 7632 / 159 = 48
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp16
- {
- class Program
- {
- static void Main(string[] args)
- {
- int r = 0;
- for(int i = 1000; i < 9999; i++)
- {
- for(int j = 111; j < 999; j++)
- {
- if(i % j == 0)
- {
- int k = i / j;
- if((k > 9) & (k < 100) & (Func1(i, j, k)))
- {
- Console.WriteLine(i + " / " + j + " = " + k);
- r++;
- }
- }
- }
- }
- Console.Read();
- Console.WriteLine("sum = " + r);
- }
- protected static bool Func1(int i, int j, int k)
- {
- int[] array = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
- bool Func1 = false;
- while (i != 0)
- {
- if (array[i % 10] > 0)
- {
- break;
- }
- i += array[i % 10];
- i /= 10;
- }
- while (j != 0)
- {
- if (array[j % 10] > 0)
- {
- break;
- }
- j += array[j % 10];
- j /= 10;
- }
- while (k != 0)
- {
- if (array[k % 10] > 0)
- {
- break;
- }
- k += array[k % 10];
- k /= 10;
- }
- Func1 = true;
- return Func1;
- }
- }
- }
- int[] array = new int[] { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
- while (i != 0)
- {
- if (array[i % 10] > 0)
- return false;
- array[i % 10] += 1;
- i /= 10;
- }
Add Comment
Please, Sign In to add comment