Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * main.c
- *
- * Created on: 22 jun. 2019
- * Author: sergiosanz
- */
- #include<stdio.h>
- int main(int argc, char *argv[])
- {
- int i = 0;
- for (int a = 0; a < 10; a++)
- {
- for (int b = 0; b < 10; b++)
- {
- for (int c = 0; c < 10; c++)
- {
- for (int d = 0; d < 10; d++)
- {
- int num = a * 1000 + b * 100 + c * 10 + d;
- int num1 = a * 10 + b;
- int num2 = b * 10 + c;
- int num3 = c * 10 + d;
- if (num1 * num2 * num3 == num)
- {
- i++;
- printf("\n%4d: %d %d %d %d", i, a, b, c, d);
- }
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment