#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main()
{
char s[20],buf[100];
int count = 0;
while(scanf("%s",s)!=EOF)
{
for(int abc = 100; abc <= 999;abc++)
{
for(int de = 10 ; de <= 99;de++)
{
int x = abc*(de/10);
int y = abc*(de%10);
int z = abc*de;
sprintf(buf,"%d%d%d%d%d",abc,de,x,y,z); //将整数输入字符串
int ok = 1;
for(int i = 0; i < strlen(buf);i++)
if(strchr(s,buf[i]) == NULL) ok = 0;//判断一个字符串中是否包含另一个字母
if(ok)
{
printf("<%d>\n",++count);
printf("%5d\nX%4d\n-----\n%5d\n%4d\n-----\n%5d\n\n",abc,de,x,y,z);
}
}
}
printf("The number of solutions = %d\n",count);
}
return 0;
}
#include <cstring>
#include <iostream>
using namespace std;
int main()
{
char s[20],buf[100];
int count = 0;
while(scanf("%s",s)!=EOF)
{
for(int abc = 100; abc <= 999;abc++)
{
for(int de = 10 ; de <= 99;de++)
{
int x = abc*(de/10);
int y = abc*(de%10);
int z = abc*de;
sprintf(buf,"%d%d%d%d%d",abc,de,x,y,z); //将整数输入字符串
int ok = 1;
for(int i = 0; i < strlen(buf);i++)
if(strchr(s,buf[i]) == NULL) ok = 0;//判断一个字符串中是否包含另一个字母
if(ok)
{
printf("<%d>\n",++count);
printf("%5d\nX%4d\n-----\n%5d\n%4d\n-----\n%5d\n\n",abc,de,x,y,z);
}
}
}
printf("The number of solutions = %d\n",count);
}
return 0;
}