13 lines
216 B
Rust
13 lines
216 B
Rust
|
|
|
|
iter range(a: int, b: int) -> int {
|
|
assert (a < b);
|
|
let i: int = a;
|
|
while i < b { put i; i += 1; }
|
|
}
|
|
|
|
fn main() {
|
|
let sum: int = 0;
|
|
for each x: int in range(0, 100) { sum += x; }
|
|
log sum;
|
|
} |