每个字母为0~9,使得式子成立
写了烂代码,过了,期待以后的改进
//#include<bits/stdc++.h>
using namespace std;
int main() {
//int b = 0, a = 0, s = 0, e = 0, l = 0, g = 0, m = 0;
//freopen("input.txt", "r", stdin);
/*
共7个字母baselgm
int base = 1000 * b + 100 * a + 10 * s + e;
int ball = 1000 * b + 100 * a + 10 * l + l;
int games = 10000 * g + 1000 * a + 100 * m + 10 * e + s;
化简 2000b+11*l+9s=10000g+800a+100m+9e
11*l+9s的十位和个位=9e的十位和个位
11*l+9s的百位和800a+100m的百位相等
800a+100m的千位与2000b一样
2000b的万位和g一样
*/
for (int l=0; l <= 9; l++) {
for (int s=0; s <= 9; s++) {
for (int a = 0; a <= 9; a++) {
for (int m = 0; m <= 9; m++) {
int left = 11 * l + 9 * s;
int right2 = 800 *