- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestProgram.java
More file actions
Latest commit
37 lines (32 loc) · 706 Bytes
/
Copy pathTestProgram.java
File metadata and controls
37 lines (32 loc) · 706 Bytes
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
classTestProgram{
publicstaticvoidmain(String[] a){
System.out.println(newTest().ComputeTest(7));
}
}
classTest {
int[] n1 ;
intn2;
publicintComputeTest(intnum){
intn;
n = num;
n1 = newint[num];
n1[0] = 11 - 1;
n1[1] = 12 + 4;
n1[2] = 13 * 2;
n1[3] = 14 + 3;
n1[4] = 15 - 3;
n1[5] = 16 + 1;
n1[6] = 17 - 2;
while(0 < n){
n = n-1;
n2 = n1[n];
System.out.println(n2);
}
if (n < 1){
System.out.println(n + 1);
} else {
System.out.println(n+ 2);
}
returnn;
}
}