This is an assignment I must complete in CSP and I'm completely dumbfounded as to how to do it:
这是我必须在CSP中完成的任务,我对如何做到这一点完全傻了:
"Get two numbers from the user. The first will be the number to count up to, the second will be the number to count by.
“从用户处获取两个号码。第一个是要计数的号码,第二个是要计算的号码。
For example, the user gives the numbers "20" and "3" 1 4 7 10 13 16 19
例如,用户给出数字“20”和“3”1 4 7 10 13 16 19
Note: it didn't actually reach 20."
注意:它实际上没达到20.“
1 个解决方案
#1
2
Seems pretty standard
看起来很标准
for i = start, finish, increment do
print(i)
end
Is a for loop, so just substitute finish and increment with the numbers and set start to 1
是一个for循环,所以只需用数字替换完成和增量,并将start设置为1
#1
2
Seems pretty standard
看起来很标准
for i = start, finish, increment do
print(i)
end
Is a for loop, so just substitute finish and increment with the numbers and set start to 1
是一个for循环,所以只需用数字替换完成和增量,并将start设置为1