题解 | #特殊乘法#
特殊乘法
https://www.nowcoder.com/practice/a5edebf0622045468436c74c3a34240f
#include<cstdio> #include<string> using namespace std ; int main (){ char arr[100]; char buf[100]; scanf ("%s %s",arr,buf); string var = arr ; string str = buf ; int mux = 0 ; for (unsigned i = 0 ; i < var.size(); ++ i ){ for (unsigned j = 0 ; j < str.size() ; ++ j ){ mux = mux + (var[i]-'0') * (str [j]-'0') ; } } printf("%d",mux); }