-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput.java
More file actions
80 lines (70 loc) · 1.92 KB
/
Copy pathinput.java
File metadata and controls
80 lines (70 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import io;
class WhileIfComplex {
int[] myField;
int myIntField;
public static void main(String[] args) {
int i;
i = 0;
while (i * 20 - 10 < 10 + 5 * 3) {
if (i < 5) {
i = i + 1;
}
else {
i = i + 2;
}
}
}
int arrayInIfTest(int... a) {
int res;
if (a[a[a[a[a[a[a[a.length - 1]]]]]]] < [1, 2, 3, 4, [1, 2, 3][0], 5][0]) {
res = 1;
}
else {
res = 0;
}
return res;
}
int arrayInWhileTest(int... a) {
int res;
res = 0;
while (a[a[a[a[a[a[a[a.length - 1]]]]]]] * a[a[a[a[a[0]]]]] < [1, 2, 3, 4, [1, 2, 3][0], 5][0]) {
res = res + 1;
a[0] = a[0] + 1;
}
return res;
}
int testingWhileWithField(int a) {
int res;
myField = [1, 2, 3, 4, 5, 6, 7, [1, 2, 3][1]];
myIntField = a;
res = 0;
while (myField[myField[myField[myField.length - 1]]] * myField[myField[myField[0]]] < [1, 2, 3, 4, [1, 2, 3][0], 5][0]) {
res = res + 1;
myField[0] = myField[0] + 1;
}
while (myIntField * myIntField * myField[0] < myIntField - [1, 2, 3, 4][2]) {
res = res + 1;
myIntField = myIntField - myField[0];
}
return res;
}
int testingIfWithField(int a) {
int res;
myField = [1, 2, 3, 4, 5, 6, 7, [1, 2, 3][1]];
myIntField = a;
res = 0;
if (myField[myField[myField[myField.length - 1]]] * myField[myField[myField[0]]] < [1, 2, 3, 4, [1, 2, 3][0], 5][0]) {
res = 1;
}
else {
res = 0;
}
if (myIntField * myIntField * myField[0] < myIntField - [1, 2, 3, 4][2]) {
res = res + 1;
}
else {
res = res + 2;
}
return res;
}
}