for-to起初是CPL语言
for-to类似for-until这是最早的(Algol60)
for-to中文名:起始终止
经过发展了for-until其实是含头不含尾,但是最早的其实不是的
步长关键字:by、step
CPL语言(1963年)
for i=1 to 5
步长:for i=1 to 5 by 2
倒置:for i=5 down to 1
题外话:
次数循环:loop for 5 times
当循环:while i<5
直到循环:do i=1 until i<5
BCPL语言(1967年)
FOR i=1 TO 5 DO {
}
步长:
FOR i=1 STEP 2 TO 5 DO {
}
Algol68语言(1968年)
FOR i BEGIN 1 TO 5 DO
OD;
步长:
FOR i BEGIN 1 BY 2 TO 5 DO
OD;
BASIC语言(1964年)
注:BASIC 依托FORTRAN,for循环吸取了Algol60
for i=1 to 5
next
步长:
for i=1 to 5 step 2
next