#include <stdio.h> #include <string.h> void main() { char input[20]; char tmp[90]; int count = 1; scanf("%s",input); for (int i=100;i<1000;i++) { for (int j=10;j<100;j++) { int a=i*(j%10); int b=i*(j/10); int c=i*j; sprintf(tmp,"%d%d%d%d%d",i,j,a,b,c); int ok = 1; for (int m=0;m<strlen(tmp);m++) { if (!strchr(input,tmp[m])) { ok=0; } } if (ok) { printf("<%d>\n",count++); printf("%5d\nX%4d\n--------\n%5d\n%4d\n--------\n%5d\n",i,j,a,b,c); } } } printf("The number of solutions = %d\n",count-1); }