作业帮 > 英语 > 作业

求解算法打出每一行的数字

来源:学生作业帮 编辑:作业帮 分类:英语作业 时间:2024/05/15 07:44:17
求解算法打出每一行的数字
Enter the number of rows:7
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
16 17 18 19 20 21
22 23 24 25 26 27 28
You can use the following commands:
 Print ‘n’– prints the content of variable ‘n’.‘n’ can be any variable.
 PrintSpace – prints one space at a time.
 GoToNextLine – allows you to go to the next time.
Your algorithm will need to have for loops,one nested into another
for(int i=1 ;i