How does this C for-loop print text-art pyramids?

后端 未结 10 1903
灰色年华
灰色年华 2021-02-05 04:24

This is my first time posting in here, hopefully I am doing it right.

Basically I need help trying to figure out some code that I wrote for class using C. The purpose o

10条回答
  •  野性不改
    2021-02-05 05:02

    Here's your code, just reformatted and stripped of comments:

    for(int tall = 0;tall

    And the same code, with some explanation interjected:

    // This is a simple loop, it will loop user_i times.
    //   tall will be [0,1,...,(user_i - 1)] inclusive.
    //   If we peek at the end of the loop, we see that we're printing a newline character.
    //   In fact, each iteration of this loop will be a single line.
    for(int tall=0; tall

提交回复
热议问题