水题
#include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> using namespace std; int main() { //freopen("D:\\t.txt", "r", stdin); string a, b; cin >> a >> b; int ans = 0; for (int i = 0; i < a.length(); i++) for (int j = 0; j < b.length(); j++) ans += (a[i] - '0') * (b[j] - '0'); printf("%d\n", ans); return 0; }