#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cstdio> #include <string> #include <stdlib.h> using namespace std; int main() { string str1, str2; while (cin >> str1 >> str2) { int answer = 0; //printf("str1 = %s\n", str1); //printf("str2 = %s\n", str2); for (int i = 0; i < str1.size(); ++i) { for (int j = 0; j < str2.size(); ++j) { answer += (str1[i] - '0') * (str2[j] - '0'); //printf("str1[%d] - '0' = %d\n", i,str1[i] - '0'); //printf("str2[%d] - '0' = %d\n", j,str2[j] - '0'); } } printf("%d\n", answer); } system("pause"); return EXIT_SUCCESS; } // 64 位输出请用 printf("%lld")