基本思想:
无;
关键点:
无;
#include<iostream> #include<vector> #include<string> using namespace std; int charge(string a, string b) { int cnt=0; for (int i = 0; i < a.size(); i++) { for (int j = 0; j < b.size(); j++) { cnt += int(a[i] - ‘0‘)*int(b[j] - ‘0‘); } } return cnt; } int main() { string n,m; while (cin >> n >> m) { cout << charge(n, m)<<endl; } return 0; }
原文地址:https://www.cnblogs.com/songlinxuan/p/12432084.html
时间: 2024-10-06 14:06:00