作者:不语皓月 | 来源:互联网 | 2023-07-05 02:17
public class C3_16
{
public static void main(String[] args)
{
for(int i=1;i<=10;i++)
{
for(int j=1;j<=11-i;j++)
System.out.print(" ");
for(int j=1;j<=i;j++)
{
if(i>=10) System.out.print(+i+" ");
else System.out.print(+i+" ");
}
System.out.println(" ");
}
}
}
运行结果:
本文出自 “桑海田 博客专栏” 博客,请务必保留此出处http://10602803.blog.51cto.com/10592803/1683065
编程打印三角形数字图案.java