Printing the Middle Row and the Lower Part of the Sign

The middle part of the figure begins with // + _, middle STOP! and an end _ + \\. The count of the underscores _ is (underscopes - 5) / 2.

The lower part of the figure, in which the width of the sign decreases, can be done by making another loop, which recurs n times. The structure of a rowis - beginning . + \\, middle _ and end // + .. The number of the points in the first iteration should be 0 and in each following one it increases by one. Therefore we can say that the size of the points in the lower part of the figure equals i.

In order for our program to work properly, in each iteration of the loop we need to decrease the number og _ with 2.

Testing in the Judge System

Test your solution here:

results matching ""

    No results matching ""