我这就是硬编出来的 嘿嘿
程序代码:
#include <stdio.h> int main(void) { int i,j,jg; char *hz[10]={"一","二","三","四","五","六","七","八","九","十"}; for(i=1;i<=9;i++) //控制行 { for(j=1;j<=i;j++) //控制列 { jg=i*j; if(jg<10) printf("%2s%2s得%-6s ",hz[i-1],hz[j-1],hz[jg-1]); //输出 if(jg==10) printf("%s%2s得%-6s ",hz[i-1],hz[j-1],hz[9]); if(jg>10 && jg<20) printf("%2s%2s得%-3s%-3s ",hz[i-1],hz[j-1],hz[9],hz[int(jg%10)-1]); if(jg==20 || jg==30 || jg==40) printf("%2s%2s得%-3s%-3s ",hz[i-1],hz[j-1],hz[int(jg/10)-1],hz[9]); if(jg>20 && jg<90 && jg!=30 && jg!=40) printf("%2s%2s得%2s%2s%2s ",hz[i-1],hz[j-1],hz[int((jg-int(jg%10))/10)-1],hz[9],hz[int(jg%10)-1]); } printf("\n"); //换行 } return 0; }
DO IT YOURSELF !