Loading...
Loading...
Loading...
Print n rows of letters. Row 1 is A, row 2 is B B, row 3 is C C C, and so on: row i has the i-th letter of the alphabet i times, with one space between letters.
Example
Input
4
Output
A B B C C C D D D D
Rows A, B B, C C C and D D D D.
Try the problem first. Open one hint at a time.
A char is a number underneath: 'A' + 2 is the code of C. Cast it back with (char).
Print a space before every letter except the first one in the row.
Write your Java code, run it on the examples and submit it to hidden tests.
Solve in the editor