特殊乘法
特殊乘法
http://www.nowcoder.com/questionTerminal/a5edebf0622045468436c74c3a34240f
#include <iostream> #include <cstdio> #include <string> using namespace std; int main(){ string str1; string str2; int sum = 0; while(cin>>str1>>str2){ int m = str1.size(); int n = str2.size(); for(int i=0;i<m;++i){ for(int j=0;j<n;++j){ sum+=(str1[i]-'0')*(str2[j]-'0'); } } } printf("%d",sum); }