显示代码纯文本
#include<iostream>
#include<cstdio>
#include<string>
using namespace std;
string a,b;
int orz(char a){
int b,c;b=a;
if(b==48)c=0;
if(b==49)c=1;
if(b==50)c=2;
if(b==51)c=3;
if(b==52)c=4;
if(b==53)c=5;
if(b==54)c=6;
if(b==55)c=7;
if(b==56)c=8;
if(b==57)c=9;
return c;
}
int main(){
freopen("cowmult.in","r",stdin);
freopen("cowmult.out","w",stdout);
cin>>a>>b;
int m,n,l=0,x,y;
m=a.length();n=b.length();
for(int i=0;i<m;i++){
x=orz(a[i]);
for(int j=0;j<n;j++){
y=orz(b[j]);
l+=x*y;
}
}
cout<<l;
return 0;
}