home > 比較編 > Perl, PHP, Python, Ruby > arrays >

ForNext

Only Do What Only You Can Do

111. iterate over range

VBScript

JScript

Perl

for $i (1..1_000_000) {
   code
}

PHP

not space efficient; use C-style for loop


Python

range replaces xrange in Python 3:
for i in xrange(1, 1000001):
   code

Ruby

(1..1_000_000).each do |i|
   code
end

PowerShell

Scala

F#

C

C++

C++Builder

VC++

C#

Java

Objective-C

D

VB

VB.NET

Delphi

Ada

PL/SQL

T-SQL

関数型

inserted by FC2 system