for循环嵌套for循环
如下列循环
//a=0;b=1,2,3,4,5\a=1,b=1,2,3,4,5 \a=2,b=1,2,3,4,5\ a=3......依次循环
#include<stdio.h>
int main()
{
int a;
int b;
int data=0;
/*
for (a=0;a<5;a++){
for (b=0;b<3;b++){
printf ("%d ",data++);
printf ("a=%d",a);
printf ("b=%d\n",b);
}
}
*/
for (a=1;a<=4;a++){
for (b=1;b<=5;b++){//a=1,b=1,2,3,4,5 a=2,b=1,2,3,4,5 a=3......
printf ("%d ",a*b);
}
printf ("\n");//单纯充当每5个值打印完换行
}
return 0;
}