好了。太简单了,不用麻烦戴老师了。
#include<stdio.h>
#define uchar unsigned char
uchar mul_table_pro[45]=
{
1,
2,4,
3,6,9,
4,8,12,16,
5,10,15,20,25,
6,12,18,24,30,36,
7,14,21,28,35,42,49,
8,16,24,32,40,48,56,64,
9,18,27,36,45,54,63,72,81
};
uchar multi1[9]={0,1,3,6,10,15,21,28,36,45};
uchar mul_pro(uchar x,uchar y)
{
uchar z;
if(x>y)
{
z=mul_table_pro[multi1[x-1]+y-1];
}
else
{
z=mul_table_pro[multi1[y-1]+x-1];
}
return z;
}
int main()
{
uchar i;
i=mul_pro(6,9);
printf("%d\n",i);
getchar();
}
|