题解 | #特殊乘法#
特殊乘法
https://www.nowcoder.com/practice/a5edebf0622045468436c74c3a34240f
#include <iostream> #include <string> using namespace std; void mul(string s1, string s2){ int res = 0; for(int i = 0; i < s1.size(); i ++){ for(int j = 0; j < s2.size(); j ++){ res += (s1[i]-'0') * (s2[j]-'0'); } } cout << res << endl; } int main() { string s1, s2; while(cin >> s1 >> s2){ mul(s1, s2); } return 0; } // 64 位输出请用 printf("%lld")