Embercode
✕
C++ PatternsCoding problems

C++ Patterns: coding problems

Write a program that reads the input and prints the answer. Run checks it against every test, including hidden ones.

0 of 7 solved

  • The sports teacher wants a row of cones on the field, and then one more cone in each row. Row 1 has one star, row 2 has two stars, and so on. Print the triangle for a given number of rows.

    **Constraints:** 1 <= n <= 100. Each row ends with a newline and has no spaces.

    Input. One integer n: the number of rows.

    Output. n lines. Line i has i stars (`*`) and nothing else.

    Example 1 input

    4
    

    Output

    *
    **
    ***
    ****
    

    Example 2 input

    1
    

    Output

    *