Commit 7159e82f authored by uwdkn's avatar uwdkn

Merge branch 'master' into 'master'

Add exec testcases group 5

See merge request IPDSnelting/mjtest-tests!44
parents 85326581 e042915e
class B {
public static void main(String[] args) {
int[] i = new int[4];
int x = 0;
while(x < 4) {
i[x] = (x = x + 1);
}
x = -1;
while(x < 4) {
System.out.println(i[(x = x + 1)]);
}
}
}
1
2
3
4
\ No newline at end of file
class Fib {
public int fib(int n) {
if(n < 2) {
return n;
}
return fib(n - 1) + fib(n - 2);
}
public static void main(String[] args) {
Fib fib = new Fib();
System.out.println(fib.fib(24));
}
}
\ No newline at end of file
46368
\ No newline at end of file
class Foo {
public Bar bar() {
return new Bar();
}
public static void main(String[] args) {
System.out.println(new Foo().bar().baz().x);
}
}
class Bar {
public Baz baz() {
Baz baz = new Baz();
baz.x = 42;
return baz;
}
}
class Baz {
public int x;
}
42
\ No newline at end of file
class B {
public static void main(String[] args) {
int min = -2147483648;
int neg_min = -min;
System.out.println(neg_min);
}
}
\ No newline at end of file
-2147483648
\ No newline at end of file
class B {
public static void main(String[] args) {
int max = 2147483647;
System.out.println(max + 1);
}
}
\ No newline at end of file
class A {
public boolean b;
public int x;
public A a;
public static void main(String[] args) {
A a = new A();
a.x = 7;
a.a = a;
System.out.println(a.a.a.x);
}
}
\ No newline at end of file
7
\ No newline at end of file
class A {
public boolean c;
public static void main(String[] args) {
boolean b = true;
A a = null;
if(b || a.c) {
System.out.println(3);
}
}
}
\ No newline at end of file
3
\ No newline at end of file
class Main {
public SystemClass System;
public static void main(String[] arguments) {
Main args = new Main();
args.System = new SystemClass();
args.System.out = new SystemClass();
args.test();
}
public void test() {
System.out.println(0);
}
}
class SystemClass {
public SystemClass out;
public void println(int num) {
System.out.println(42);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment