题解 | #特殊乘法#

特殊乘法

https://www.nowcoder.com/practice/a5edebf0622045468436c74c3a34240f

#include <bits/stdc++.h>

using namespace std;

int main(){
	string s1,s2;
	
	while(cin >> s1 >> s2){
		int ans = 0;
		for(int i = 0;i < s1.size();i ++){
			for(int j = 0;j < s2.size();j ++){
				ans += (s1[i] - '0') * (s2[j] - '0');
			}
		}
		cout << ans << endl;
	} 
	return 0;
}

全部评论

相关推荐

04-14 20:10
已编辑
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务