-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain_24.java
More file actions
60 lines (60 loc) · 1.48 KB
/
Main_24.java
File metadata and controls
60 lines (60 loc) · 1.48 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
public class Main_24 {
public static void main(String[] args) {
for (int i=0; i<5; i++){
System.out.println(i);
System.out.println("java");
if (i==2){
System.out.println("end loop");
break;
}
}
for (int i=0; i<5; i++){
if (i==2){
System.out.println("end loop");
continue;
}
System.out.println(i);
System.out.println("java");
}
int i=0;
while(i<5) {
System.out.println(i);
System.out.println("c");
i++;
if (i == 2) {
System.out.println("end loop");
break;
}
}
while(i<5) {
i++;
if (i == 2) {
System.out.println("end loop");
break;
}
System.out.println(i);
System.out.println("c");
}
int j=0;
do{
System.out.println(j);
System.out.println("c++");
j++;
if (j==2){
System.out.println("end loop");
break;
}
}
while (j<5);
do{
j++;
if (j==2){
System.out.println("end loop");
continue;
}
System.out.println(j);
System.out.println("c++");
}
while (j<5);
}
}