opt: 人工分拣与自动分拣一样的功能
This commit is contained in:
@@ -72,16 +72,13 @@ public class test {
|
||||
|
||||
@Test
|
||||
void test03() {
|
||||
try {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
System.out.println(i);
|
||||
if (i==3) {
|
||||
throw new RuntimeException("1");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
String[] parts = "168".split("\\*"); // 使用 "*" 来分割字符串
|
||||
int result = 1; // 初始化结果为1
|
||||
for (String part : parts) {
|
||||
int number = Integer.parseInt(part); // 将字符串部分解析为整数
|
||||
result *= number; // 将解析的整数与结果相乘
|
||||
}
|
||||
System.out.println(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user