#include <stdio.h>#include <string.h>int main(){int i,j;int a;for (i = 1; i < 10; i++){for (j = 1; j <= i; j++){a = j * i;printf(\"%d*%d=%-5d\", j, i, a); //-5实现左对齐让代码更加美观}printf(\"\\n\");}}
C语言实现乘法口诀表
未经允许不得转载:爱站程序员基地 » C语言实现乘法口诀表
#include <stdio.h>#include <string.h>int main(){int i,j;int a;for (i = 1; i < 10; i++){for (j = 1; j <= i; j++){a = j * i;printf(\"%d*%d=%-5d\", j, i, a); //-5实现左对齐让代码更加美观}printf(\"\\n\");}}