标签:todo code || imp method int() can ack ati
package erase; import java.util.Scanner; public class 杨辉三角形 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner in=new Scanner(System.in); int n=in.nextInt(); int m[][]=new int[n][n]; for(int i=0;i<n;i++) {//行 for(int j=0;j<=i;j++) { if(j==0||i==j)m[i][j]=1; else { m[i][j]=m[i-1][j]+m[i-1][j-1]; } System.out.print(m[i][j]+" "); } System.out.print(‘\n‘); } } }
标签:todo code || imp method int() can ack ati
原文地址:https://www.cnblogs.com/chenxi1944362410/p/13053748.html