Get the App
SLTechnology News&Howtos  ›  Development  › 

How to print a 10-row Yang Hui triangle using a two-dimensional array by java

Shulou Source: shulou.com Published: 2022-06-01 04:16:23 10月26日 Update

Editor to share with you how java uses a two-dimensional array to print a 10-line Yang Hui triangle. I believe most people don't know much about it, so share this article for your reference. I hope you will gain a lot after reading this article. Let's learn about it together.

Use a two-dimensional array to print a 10-line Yang Hui triangle public class T02 {public static void main (String [] args) {/ / declare and initialize the array int [] [] arr=new int [10] []; / assign for to the elements of the array

< arr.length;i++){ arr[i]=new int[i+1]; arr[i][0]=arr[i][i]=1; if(i>

1) {for (int kryp1witk)

Tags: Array Yang Hui Triangle Yang Hui Triangle two-dimensional articles content not much elements most more knowledge Industry Information Channel Channel reference Learning help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Shulou Technology MariaDB Microsoft Redmi