题解 | #特殊乘法#

特殊乘法

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

#include<iostream>
#include<cstdio>
#include<string>

using namespace std;

int main()
{
    string str1,str2;
    cin>>str1>>str2;
    int ans=0;
    for(int i=0;i<str1.size();i++)
    {
        for(int j=0;j<str2.size();j++)
        {
            ans+=(str1[i]-'0')*(str2[j]-'0');
        }
    }
    cout<<ans<<endl;
    return 0;
}
全部评论

相关推荐

评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务