#include <stdio.h>
int main(int argc, const char *argv[])
{
int i;
int sum;
for(i=1;i<=9;i++){
int j;
for(j=1;j<=i;j++){
sum =i*j;
printf("%d*%d=%d ",i,j,sum);
}
printf(" \n");
}
return 0;
}
运行结果:
#include <stdio.h>
int main(int argc, const char *argv[])
{
int i;
int sum;
for(i=1;i<=9;i++){
int j;
for(j=1;j<=i;j++){
sum =i*j;
printf("%d*%d=%d ",i,j,sum);
}
printf(" \n");
}
return 0;
}
运行结果: