题解 | #特殊乘法#
特殊乘法
http://www.nowcoder.com/practice/a5edebf0622045468436c74c3a34240f
不用太麻烦,直接整个字符串存起来就好了
#include <iostream>
#include <string>
using namespace std;
int main()
{
string s1, s2;
cin >> s1 >> s2;
long long 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;
return 0;
}