compiler-design-eth/javali_tests/HW4/OkDifferentReads.javali
Carlos Galindo 72cc3206c4
Homework 4
2020-01-15 22:34:57 +01:00

28 lines
394 B
Text

/* Test read() with different kinds of LHS values */
class Main {
int x;
void main() {
int y;
int[] arr;
write(1);
writeln();
y = read();
write(y + 1);
writeln();
x = read();
write(x + 1);
writeln();
arr = new int[64];
arr[x] = read();
write(arr[x] + 1);
writeln();
}
}