Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to realize Yang Hui Triangle by Java

Shulou Source: shulou.com Published: 2022-06-01 11:21:20 09月29日 Update

This article mainly explains "how to realize Yang Hui Triangle by Java". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to realize the Yang Hui Triangle by Java".

Topic output Yang Hui Triangle

1. Program analysis

The solution is carried out by using the characteristics of Yang Hui triangle.

2. Program realization

/ * Topic: Yang Hui Triangle * File Name: Triangle.c * Author: Jack Cui * Created: 9 April 2016 * * * / # include # include / * declare Yang Hui triangulation printing function * / int Triangle (int iHeigh) Void main (void) {int iHeigh,flag = 1; / / height, cycle marker while (flag) {printf ("Please enter the number of layers of Yang Hui Triangle:\ n"); scanf ("% d", & iHeigh); flag = Triangle (iHeigh) Function name: Triangle* parameter description: iHeigh Yang Hui triangle need to print height * description: Yang Hui triangle print * * / int Triangle (int iHeigh) {int iNum,iLine,iColumn / / numeric value, row number 1 represents the first row, column number 1 represents the first column if (iHeigh

Tags: Yang Hui Yang Hui triangle triangle input output error line representative content function program height learning practical deeper information interest parameter name practicality Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Shulou Information MySQL Linux macOS