题解 | #特殊乘法#
特殊乘法
https://www.nowcoder.com/practice/a5edebf0622045468436c74c3a34240f
#include <stdio.h>
#define N 12
int a[N];
int b[N];
int main() {
int x, y;
while(scanf("%d%d",&x,&y) != EOF){
int i = 0;
int j = 0;
int cnt = 0;
while(x != 0){
a[i ++] = x % 10;
x /= 10;
}
while(y != 0){
b[j ++] = y % 10;
y /= 10;
}
for(int k = 0;k < i;k ++){
for(int l = 0;l < j;l ++){
cnt += a[k] * b[l];
}
}
printf("%d\n",cnt);
}
return 0;
}

查看3道真题和解析