homework : ) 找不到源码

源代码在线查看: test_2.java

软件大小: 22 K
上传用户: teasler111
关键词: homework 源码
下载地址: 免注册下载 普通下载 VIP

相关代码

				public class test_2
				{
					private static final int SIZE = 8;
					
					public static void main(String[] args)
					{
						int[][] triangle=new int[SIZE][];
						for (int row=1;row						{
							triangle[row-1]=new int[row];
							for (int column=1;column							{
								if (row==1)
									triangle[row-1][column-1] = 1;
								else if (row==2)
									triangle[row-1][column-1] = 1;
								else 
								{
									if (column==1||column==row)
										triangle[row-1][column-1] = 1;
									else triangle[row-1][column-1]=triangle[row-2][column-2]+triangle[row-2][column-1];
								}
							}
						}
						for (int row = 1; row 							for (int column=1; column								System.out.print(triangle[row-1][column-1]+" ");
							}
							System.out.println();
						}
					}
				}			

相关资源