/*输出 n=6 的三角数字阵
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
16 17 18 19 20 21
*/
class SanJiaoShuZiZhen
{
public static void main(String[] args)
{
int a=1;
for (int x=1;x<=6 ;x++ )
{
for (int y=1;y<=x ;y++ )
{
System.out.print(a+" ");
a++;
}
System.out.println();
}
}
}
|
|