blob: cb878f697f068050daf7c643c38e3c2874b42d0c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
fn sumbytes(n) {
let buf[64], i = 0, s = 0, b, reps, ch;
while (i < 64) { buf[i] = i * 0x0101010101010101; i++; }
b = addr_b(buf);
ch = get_c();
reps = 0;
while (ch >= '0' && ch <= '9') { reps = reps * 10 + ch - '0'; ch = get_c(); }
while (reps > 0) {
i = 0; s = 0;
while (i < n) { s = s + ld8(b + (i & 511)); i++; }
reps--;
}
return s;
}
fn main() {
put_n(sumbytes(4000));
put_c(10);
return 0;
}
|