robin88 • 11个月前
using namespace std; / run this program using the console pauser or add your own getch, system("pause") or input loop /
int main(int argc, char** argv) {
int a[10]={0},b[10]={0},total=0;
string A,B;
cin>>A>>B;
for(int i=0;i<A.length();i++){
a[i]=int(A[i]);
a[i]=a[i]-48;
}
for(int i=0;i<B.length();i++){
b[i]=int(B[i]);
b[i]=b[i]-48;
}
for(int i=0;i<A.length();i++){
for(int j=0;j<B.length();j++){
total=total+a[i]*b[j];
}
}
cout<<total;
return 0;
}
评论:
请先登录,才能进行评论