记录java编程练习
/* 1 1 2 1 1 2 3 2 1 数字金字塔 */
import java.util.Scanner;
public class shuzisanjiao
{
public static void main(String[] args)
{ System.out.println("请输入要打印的行数:");
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
for(int i=1;i<=n;i++){
for(int j=1;j<=7-i;j++)
{ System.out.print(" ");
} for(int j=1;j<=i;j++){ System.out.print(" "+j); }
for(int j=i;j>1;j--){ System.out.print(" "+(j-1));
} System.out.println();
} } }