Homework B (benchmarks)
This commit is contained in:
parent
72cc3206c4
commit
76fbabdf53
141 changed files with 7540 additions and 2032 deletions
40
benchmarks/HWB_nop90/AFewConstants.javali
Normal file
40
benchmarks/HWB_nop90/AFewConstants.javali
Normal file
|
@ -0,0 +1,40 @@
|
|||
class Main {
|
||||
int SIZE;
|
||||
|
||||
void main() {
|
||||
int[] a;
|
||||
int i;
|
||||
int pi;
|
||||
int e;
|
||||
int thou;
|
||||
|
||||
pi = 3141;
|
||||
e = 2718;
|
||||
|
||||
a = readStuff();
|
||||
|
||||
i = 0;
|
||||
while(i < SIZE) {
|
||||
write(pi * e * a[i] / (1000 * 1000));
|
||||
writeln();
|
||||
write(a[i] * pi * e / (1000 * 1000));
|
||||
writeln();
|
||||
i = i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
int[] readStuff() {
|
||||
int[] a;
|
||||
int i;
|
||||
|
||||
SIZE = 5;
|
||||
a = new int[SIZE];
|
||||
|
||||
i = 0;
|
||||
while (i < SIZE) {
|
||||
a[i] = read();
|
||||
i = i + 1;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
}
|
5
benchmarks/HWB_nop90/AFewConstants.javali.in
Normal file
5
benchmarks/HWB_nop90/AFewConstants.javali.in
Normal file
|
@ -0,0 +1,5 @@
|
|||
42
|
||||
1337
|
||||
9000
|
||||
12345678
|
||||
777
|
13
benchmarks/HWB_nop90/Unused.javali
Normal file
13
benchmarks/HWB_nop90/Unused.javali
Normal file
|
@ -0,0 +1,13 @@
|
|||
class Main {
|
||||
void main() {
|
||||
int i;
|
||||
int j;
|
||||
i = read();
|
||||
j = 2 * i;
|
||||
|
||||
i = (i + 31) / 2;
|
||||
j = (i * j) / 3;
|
||||
|
||||
write(i);
|
||||
}
|
||||
}
|
1
benchmarks/HWB_nop90/Unused.javali.in
Normal file
1
benchmarks/HWB_nop90/Unused.javali.in
Normal file
|
@ -0,0 +1 @@
|
|||
43
|
Loading…
Add table
Add a link
Reference in a new issue