After-school assignments use a for loop to embed a diamond

Source: Internet
Author: User

for (int i = 1; I <= one; i++)//I is a starting value of <=11; Increment the {int A, B, c;//to define the ABC three number for (a = one; a > i; a--)//A This is a descending starting value is                                     11 when i=1//a value is 11 output 11 blank Console.Write (""); for (b = 1; b <= i; b++)//When the above outputs 11 blanks, B outputs a "*" and so on

Console.Write ("*");//When the above outputs 11 blanks, B outputs a "*"
for (c = 1; c < (b-1); C + +) Console.Write ("*"); Console.WriteLine (); } for (int i = 1; I <= one; i++) {int d, E, F; for (d = 1; d <= i; d++) Console.Write (""); for (E = 10;e >= i;e--) console.write ("*"); for (f = ten; F > (e+1); f--) Console.Write ("*"); Console.WriteLine (); } console.readline ();


After-school assignments use a for loop to embed a diamond

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.