2080 : A+B or A-B

时间限制:1 Sec 内存限制:0 MiB
提交:15 答案正确:5

提交 状态 讨论区

题目描述

Give you three strings s1, s2 and s3. These strings contain only capital letters A,B,C,D,E. The letters that appear in the string represent a number from 0 to 9.Each letter represents a different number.Now we want to know how many four equations these strings can form. In other words, you need to calculate how many ways that s1+s2=s3
or s1-s2=s3 or s1*s2=s3 or s1/s2=s3. Notice that the leading 0 is not legal.

输入

Multiple sample input until the end of the file
The three strings represent s1, s2, s3, and their length will not exceed 5

输出

The total number of ans

样例输入

复制
A A A

样例输出

复制
5

提示


			

来源