2010-07-22 14:11:39 -05:00
|
|
|
iter range(int a, int b) -> int {
|
2011-05-02 19:47:24 -05:00
|
|
|
assert (a < b);
|
2010-07-22 14:11:39 -05:00
|
|
|
|
|
|
|
let int i = a;
|
|
|
|
while (i < b) {
|
|
|
|
put i;
|
|
|
|
i += 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let int sum = 0;
|
|
|
|
for each (int x in range(0, 100)) {
|
|
|
|
sum += x;
|
|
|
|
}
|
|
|
|
|
|
|
|
log sum;
|
|
|
|
}
|