[c]算是简单易懂的暴力算法
#include<stdio.h>
int main()
{
long long m ,n,k;
int ans = 0;
while(scanf("%d%d",&m,&n)!=EOF)
{
k = m;
while(n!=0)
{
m = k;
while(m!=0)
{
ans = ans + (m%10)*(n%10);
m = (m - (m%10))/10;
}
n = (n - (n%10))/10;
}
printf("%d\n",ans);
ans = 0;
}
return 0;
}
登录后发布评论