-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMan.java
More file actions
25 lines (20 loc) · 671 Bytes
/
Man.java
File metadata and controls
25 lines (20 loc) · 671 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
import java.util.ArrayList;
import java.util.List;
public class Man {
public static void main(String[] args) {
String s = "K1:L2";
List<String> li = new ArrayList<>();
char startChar = s.charAt(0);
char endChar = s.charAt(3);
int startNum = Integer.parseInt(s.charAt(1) + "");
int endNum = Integer.parseInt(s.charAt(4) + "");
for (char ch = startChar; ch <= endChar; ch++) {
for (int a = startNum; a <= endNum; a++) {
String ans = ch + "" + a;
System.out.println(ans);
li.add(ans);
}
}
System.out.println(li);
}
}