From a6bee58963dc2801bbb78d2fe5592af877be8b99 Mon Sep 17 00:00:00 2001 From: algorithmzuo Date: Sat, 3 Sep 2022 18:19:15 +0800 Subject: [PATCH] modify code --- 算法周更班/class_2022_08_5_week/Code01_Cakes.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/算法周更班/class_2022_08_5_week/Code01_Cakes.java b/算法周更班/class_2022_08_5_week/Code01_Cakes.java index c63836e..f182866 100644 --- a/算法周更班/class_2022_08_5_week/Code01_Cakes.java +++ b/算法周更班/class_2022_08_5_week/Code01_Cakes.java @@ -43,7 +43,7 @@ public class Code01_Cakes { } for (int pick = 1; pick <= Math.min(b, m); pick++) { if (whoWin1(a, b - pick, m).equals("后手")) { - return "先手"; + ans = "先手"; } if (ans.equals("先手")) { break; @@ -85,10 +85,8 @@ public class Code01_Cakes { } public static void main(String[] args) { - int V = 23; + int V = 100; System.out.println("测试开始"); - int cnt = 0; - int all = (V + 1) * (V + 1) * (V + 1); for (int a = 0; a <= V; a++) { for (int b = 0; b <= V; b++) { for (int m = 0; m <= V; m++) { @@ -103,10 +101,6 @@ public class Code01_Cakes { System.out.println("ans2 : " + ans2); break; } - cnt++; - if (cnt % 1000 == 0) { - System.out.println("已经测了" + cnt + "组(共" + all + "组)"); - } } } }