题解 | #特殊乘法#
特殊乘法
https://www.nowcoder.com/practice/a5edebf0622045468436c74c3a34240f?tpId=40&tqId=21349&rp=1&ru=/ta/kaoyan&qru=/ta/kaoyan&difficulty=2&judgeStatus=&tags=/question-ranking
#include <bits/stdc++.h> using namespace std; int main(){ long long m,n; while(cin>>m>>n){ long long sum = 0; vector<long long> m1,n1; while(m){ m1.push_back(m%10); m/=10; } while(n){ n1.push_back(n%10); n/=10; } for(int i=0;i<m1.size();i++){ for(int j=0;j<n1.size();j++){ sum += m1[i]*n1[j]; } } cout<<sum<<endl; } return 0; }