beyondgrader.com Logo
DemoBrowseAboutTeamLogin

Triangle String

[email protected] // 1.0

Given a string like "ABC", let's say its triangle is the result of printing its last character on one line, its last two on the next line, and so on until the full length of the string:

C
BC
ABC

Assume a string variable called text has been set for you. Print its triangle.