---
title: "赛软件 * 比赛  =  软件比拼"
author: "smallearth"
date: "2012-03-10T14:14:00Z"
tags: []
slug: "untitled"
draft: false
lastmod: "2013-11-30T20:10:51Z"
id: 1983344
url: "https://smallearth.iteye.com/blog/1983344"
---

1\. (编程题)下列乘法算式中：每个汉字代表1个数字（1~9）。相同的汉字代表相同的数字，不同的汉字代表不同的数字。

赛软件 * 比赛 = 软件比拼

试编程确定使得整个算式成立的数字组合，如有多种情况，请给出所有可能的答案。

【参考结果】

465 * 14 = 6510

// jkkj.cpp : 定义控制台应用程序的入口点。  
#include"stdafx.h"  
//  
#include&lt;iostream&gt;  
using namespace std;  
int main()  
{  
int a=100,b=10,c;

for(a=100;a&lt;1000;a=a+1)  
{  
for(b=10;b&lt;100;b=b+1)//465 * 14 = 6510

{  
c=a\*b;

int m,n,i,j,k,h,x,y;  
m=a/100; n=b-(b/10)\*10;  
i=a/10-m\*10; j=c/1000;  
k=a-m\*100-i\*10; h=c/100-j\*10;  
x=b/10; y=c/10-j\*100-h\*10;

if(m==n&&i==j&&k==h&&x==y&&c&lt;10000)  
{  
cout&lt;&lt;a&lt;&lt;"\*"&lt;&lt;b&lt;&lt;"="&lt;&lt;c&lt;&lt;endl;  
}  
}  
}  
return 0;  
}