Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to print Diamond pattern in VB language

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to print diamond patterns in VB language. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Print diamond pattern

Classroom summary

The main thing is to summarize the ideas of analysis.

1. Observe the pattern and summarize the rules.

2. you can write it down, write down the line number and the result, and then observe

3. The train of thought of the lower part is just the opposite of the upper part, so we should write it down and make a summary and observation.

Interface:

Source code:

Private Sub Form_Load () ShowFontSize = 25WindowState = 2Dim i As LongDim j As Long

Dim n As Long 'indicates the number of rows, which is the number except for the longest row * n = 6' upper half For I = 0 To n Step 1

'output space For j = 1 To n-I Step 1 Print "; Next j

'output * For j = 1 To 2 * I + 1 Step 1 Print "*"; Next j Print' wrap Next I

'lower half For I = 0 To n-1 Step 1

'output space For j = 0 To i Step 1 Print "; Next j' output * For j = 1 To 2 * (n-I)-1 Step 1 Print" * "; Next j Print

Next i

End Sub

On how to print diamond patterns in VB language to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report