AC了

robin88 · 发布于 2024-07-22 · 浏览 771 回复 0

include

include

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;

}

全部回复 共 0 条

还没有人回复。往下写第一条。

发表回复