题意:
给你三个数A, B, C(没有前导0),但是其中某些位不知道。 问A+B=C成立有多少种情况。
思路:
从最后一位往前推,枚举A, B的每一种情况,考虑进位和不进位两种情况。
代码:
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 5 using namespace std; 6 7 typedef long long ll; 8 9 const ll MOD = (ll)1e9+7; 10 const int MAXN = 100; 11 12 ll dp[MAXN][2]; 13 char str[3][MAXN]; 14 15 int main() { 16 #ifdef Phantom01 17 freopen("CSU1374.txt", "r", stdin); 18 #endif // Phantom01 19 20 while (scanf("%s", str[0])!=EOF) { 21 if ('0'==str[0][0]&&'