作者:123妖_精 | 来源:互联网 | 2023-08-05 20:38
Iwanttouseprintfandforlooptoprintacharactermultipletimesperlinedependingontheinpu
I want to use printf and for loop to print a character multiple times per line depending on the input; i.e. if the input is 3 i want to print:
我想使用printf和for循环每行多次打印一个字符,具体取决于输入;即如果输入为3我想要打印:
a
aa
aaa
this is the loop, which doesn't work at all.
这是循环,根本不起作用。
for (int i = 0; i
I just don't understand how to print it multiple times on a single line.
我只是不明白如何在一行上多次打印。
2 个解决方案