diff --git a/bin/Main.class b/bin/Main.class index 5ecfc8f..dd34eb4 100644 Binary files a/bin/Main.class and b/bin/Main.class differ diff --git a/exercise/bin/P1098.class b/exercise/bin/P1098.class new file mode 100644 index 0000000..d5860e4 Binary files /dev/null and b/exercise/bin/P1098.class differ diff --git a/exercise/bin/P2840.class b/exercise/bin/P2840.class new file mode 100644 index 0000000..a1d0ec9 Binary files /dev/null and b/exercise/bin/P2840.class differ diff --git a/exercise/bin/P2857.class b/exercise/bin/P2857.class new file mode 100644 index 0000000..4a674b5 Binary files /dev/null and b/exercise/bin/P2857.class differ diff --git a/exercise/bin/P2895.class b/exercise/bin/P2895.class new file mode 100644 index 0000000..9f6d709 Binary files /dev/null and b/exercise/bin/P2895.class differ diff --git a/exercise/bin/P2966.class b/exercise/bin/P2966.class new file mode 100644 index 0000000..55f1d92 Binary files /dev/null and b/exercise/bin/P2966.class differ diff --git a/exercise/bin/P2967.class b/exercise/bin/P2967.class new file mode 100644 index 0000000..05d5639 Binary files /dev/null and b/exercise/bin/P2967.class differ diff --git a/exercise/bin/P2969.class b/exercise/bin/P2969.class new file mode 100644 index 0000000..4dd3ac7 Binary files /dev/null and b/exercise/bin/P2969.class differ diff --git a/exercise/bin/P2975.class b/exercise/bin/P2975.class new file mode 100644 index 0000000..3c9ad34 Binary files /dev/null and b/exercise/bin/P2975.class differ diff --git a/exercise/bin/P2977.class b/exercise/bin/P2977.class new file mode 100644 index 0000000..85d8c81 Binary files /dev/null and b/exercise/bin/P2977.class differ diff --git a/exercise/bin/P2984.class b/exercise/bin/P2984.class new file mode 100644 index 0000000..2b774d3 Binary files /dev/null and b/exercise/bin/P2984.class differ diff --git a/exercise/bin/P2989.class b/exercise/bin/P2989.class new file mode 100644 index 0000000..81fc5cc Binary files /dev/null and b/exercise/bin/P2989.class differ diff --git a/exercise/bin/PTable.class b/exercise/bin/PTable.class new file mode 100644 index 0000000..6597c23 Binary files /dev/null and b/exercise/bin/PTable.class differ diff --git a/exercise/src/Main.class b/exercise/src/Main.class deleted file mode 100644 index 117df1e..0000000 Binary files a/exercise/src/Main.class and /dev/null differ diff --git a/exercise/src/Main.java b/exercise/src/Main.java index 8ec5a42..9188281 100644 --- a/exercise/src/Main.java +++ b/exercise/src/Main.java @@ -1,48 +1,41 @@ import java.util.Scanner; -import java.util.HashMap; -import java.util.Map; -import java.math.BigInteger; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); - if (!in.hasNext()) { - System.out.print("no"); - in.close(); - return; - } - int n = Integer.parseInt(in.next()); - if (n <= 0) { - System.out.print("no"); - in.close(); - return; - } - - Map cnt = new HashMap<>(); - Map first = new HashMap<>(); - String best = null; - int bestCount = 0; - int bestIdx = Integer.MAX_VALUE; - int idx = 0; - while (idx < n && in.hasNext()) { - String raw = in.next(); - String norm = new BigInteger(raw).toString(); - int c = cnt.getOrDefault(norm, 0) + 1; - cnt.put(norm, c); - if (!first.containsKey(norm)) - first.put(norm, idx); - int fi = first.get(norm); - if (best == null || c > bestCount || (c == bestCount && fi < bestIdx)) { - best = norm; - bestCount = c; - bestIdx = fi; + int n = in.nextInt(); + int[] mention = new int[101]; + boolean[][] by = new boolean[101][101]; + for (int i = 0; i < n; i++) { + int sender = in.nextInt(); + int k = in.nextInt(); + for (int j = 0; j < k; j++) { + int id = in.nextInt(); + if (id >= 0 && id <= 100) { + mention[id]++; + if (sender >= 0 && sender <= 100) by[id][sender] = true; + } } - idx++; } - if (best == null) - System.out.print("no"); - else - System.out.print(best); + int bestId = 0; + int bestCount = -1; + for (int id = 0; id <= 100; id++) { + if (mention[id] > bestCount) { + bestCount = mention[id]; + bestId = id; + } + } + System.out.println(bestId); + StringBuilder sb = new StringBuilder(); + boolean first = true; + for (int s = 0; s <= 100; s++) { + if (by[bestId][s]) { + if (!first) sb.append(' '); + sb.append(s); + first = false; + } + } + System.out.println(sb.toString()); in.close(); } } \ No newline at end of file diff --git a/作业/作业/刘航宇-day41/第一题/Main.java b/作业/作业/刘航宇-day41/第一题/Main.java new file mode 100644 index 0000000..e57185b --- /dev/null +++ b/作业/作业/刘航宇-day41/第一题/Main.java @@ -0,0 +1,26 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String s = in.nextLine().trim(); + String[] parts = s.split("-"); + int y = Integer.parseInt(parts[0]); + int m = Integer.parseInt(parts[1]); + int d = Integer.parseInt(parts[2]); + int[] days = {0,31,28,31,30,31,30,31,31,30,31,30,31}; + boolean leap = (y % 4 == 0 && y % 100 != 0) || (y % 400 == 0); + if (leap) days[2] = 29; + d++; + if (d > days[m]) { + d = 1; + m++; + if (m > 12) { + m = 1; + y++; + } + } + System.out.printf("%04d-%02d-%02d", y, m, d); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day41/第一题/image.png b/作业/作业/刘航宇-day41/第一题/image.png new file mode 100644 index 0000000..0271c96 Binary files /dev/null and b/作业/作业/刘航宇-day41/第一题/image.png differ diff --git a/作业/作业/刘航宇-day41/第三题/Main.java b/作业/作业/刘航宇-day41/第三题/Main.java new file mode 100644 index 0000000..9188281 --- /dev/null +++ b/作业/作业/刘航宇-day41/第三题/Main.java @@ -0,0 +1,41 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int n = in.nextInt(); + int[] mention = new int[101]; + boolean[][] by = new boolean[101][101]; + for (int i = 0; i < n; i++) { + int sender = in.nextInt(); + int k = in.nextInt(); + for (int j = 0; j < k; j++) { + int id = in.nextInt(); + if (id >= 0 && id <= 100) { + mention[id]++; + if (sender >= 0 && sender <= 100) by[id][sender] = true; + } + } + } + int bestId = 0; + int bestCount = -1; + for (int id = 0; id <= 100; id++) { + if (mention[id] > bestCount) { + bestCount = mention[id]; + bestId = id; + } + } + System.out.println(bestId); + StringBuilder sb = new StringBuilder(); + boolean first = true; + for (int s = 0; s <= 100; s++) { + if (by[bestId][s]) { + if (!first) sb.append(' '); + sb.append(s); + first = false; + } + } + System.out.println(sb.toString()); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day41/第三题/image.png b/作业/作业/刘航宇-day41/第三题/image.png new file mode 100644 index 0000000..fec48c2 Binary files /dev/null and b/作业/作业/刘航宇-day41/第三题/image.png differ diff --git a/作业/作业/刘航宇-day41/第二题/Main.java b/作业/作业/刘航宇-day41/第二题/Main.java new file mode 100644 index 0000000..a26171f --- /dev/null +++ b/作业/作业/刘航宇-day41/第二题/Main.java @@ -0,0 +1,59 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int n = in.nextInt(); + long[] w = new long[n]; + long[] dist = new long[n]; + for (int i = 0; i < n; i++) { + w[i] = in.nextLong(); + dist[i] = in.nextLong(); + } + long[] pos = new long[n]; + long L = 0; + for (int i = 0; i < n; i++) + L += dist[i]; + for (int i = 1; i < n; i++) + pos[i] = pos[i - 1] + dist[i - 1]; + int m = 2 * n; + long[] pos2 = new long[m]; + long[] w2 = new long[m]; + for (int i = 0; i < m; i++) { + int j = i % n; + pos2[i] = pos[j] + (long) (i / n) * L; + w2[i] = w[j]; + } + long[] preW = new long[m + 1]; + long[] preWP = new long[m + 1]; + for (int i = 0; i < m; i++) { + preW[i + 1] = preW[i] + w2[i]; + preWP[i + 1] = preWP[i] + w2[i] * pos2[i]; + } + int r = 0; + long bestCost = Long.MAX_VALUE; + int bestIdx = 0; + for (int i = 0; i < n; i++) { + if (r < i) + r = i; + while (r + 1 < i + n && pos2[r + 1] - pos2[i] <= L / 2) + r++; + long sumWcw = preW[r + 1] - preW[i]; + long sumWPcw = preWP[r + 1] - preWP[i]; + long sumWtot = preW[i + n] - preW[i]; + long sumWPtot = preWP[i + n] - preWP[i]; + long sumWccw = sumWtot - sumWcw; + long sumWPccw = sumWPtot - sumWPcw; + long posi = pos2[i]; + long costCW = sumWPcw - posi * sumWcw; + long costCCW = sumWccw * L + posi * sumWccw - sumWPccw; + long cost = costCW + costCCW; + if (cost < bestCost || (cost == bestCost && i < bestIdx)) { + bestCost = cost; + bestIdx = i; + } + } + System.out.println(bestIdx + "," + bestCost); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day41/第二题/image.png b/作业/作业/刘航宇-day41/第二题/image.png new file mode 100644 index 0000000..e69de29 diff --git a/作业/刘航宇-day42/第一题/P2857.java b/作业/刘航宇-day42/第一题/P2857.java new file mode 100644 index 0000000..91c60a1 --- /dev/null +++ b/作业/刘航宇-day42/第一题/P2857.java @@ -0,0 +1,41 @@ +import java.util.Scanner; + +public class P2857 { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int n = in.nextInt(); + int[] mention = new int[101]; + boolean[][] by = new boolean[101][101]; + for (int i = 0; i < n; i++) { + int sender = in.nextInt(); + int k = in.nextInt(); + for (int j = 0; j < k; j++) { + int id = in.nextInt(); + if (id >= 0 && id <= 100) { + mention[id]++; + if (sender >= 0 && sender <= 100) by[id][sender] = true; + } + } + } + int bestId = 0; + int bestCount = -1; + for (int id = 0; id <= 100; id++) { + if (mention[id] > bestCount) { + bestCount = mention[id]; + bestId = id; + } + } + System.out.println(bestId); + StringBuilder sb = new StringBuilder(); + boolean first = true; + for (int s = 0; s <= 100; s++) { + if (by[bestId][s]) { + if (!first) sb.append(' '); + sb.append(s); + first = false; + } + } + System.out.println(sb.toString()); + in.close(); + } +} \ No newline at end of file diff --git a/作业/刘航宇-day42/第一题/image.png b/作业/刘航宇-day42/第一题/image.png new file mode 100644 index 0000000..70fe3e0 Binary files /dev/null and b/作业/刘航宇-day42/第一题/image.png differ diff --git a/作业/刘航宇-day42/第三题/P2840.java b/作业/刘航宇-day42/第三题/P2840.java new file mode 100644 index 0000000..856ad92 --- /dev/null +++ b/作业/刘航宇-day42/第三题/P2840.java @@ -0,0 +1,17 @@ +import java.util.*; + +public class P2840 { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + List nums = new ArrayList<>(); + while (in.hasNextInt()) nums.add(in.nextInt()); + Collections.sort(nums); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < nums.size(); i++) { + if (i > 0) sb.append(' '); + sb.append(nums.get(i)); + } + System.out.println(sb.toString()); + in.close(); + } +} \ No newline at end of file diff --git a/作业/刘航宇-day42/第三题/image.png b/作业/刘航宇-day42/第三题/image.png new file mode 100644 index 0000000..70fe3e0 Binary files /dev/null and b/作业/刘航宇-day42/第三题/image.png differ diff --git a/作业/刘航宇-day42/第二题/P1098.java b/作业/刘航宇-day42/第二题/P1098.java new file mode 100644 index 0000000..53b6ba6 --- /dev/null +++ b/作业/刘航宇-day42/第二题/P1098.java @@ -0,0 +1,25 @@ +import java.util.*; + +public class P1098 { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + List a = new ArrayList<>(); + while (in.hasNextInt()) a.add(in.nextInt()); + StringBuilder first = new StringBuilder(); + StringBuilder second = new StringBuilder(); + boolean f = true; + for (int i = 0; i < a.size(); i++) { + if ((i & 1) == 0) { + if (!f) first.append(' '); + first.append(a.get(i)); + f = false; + } else { + if (second.length() > 0) second.append(' '); + second.append(a.get(i)); + } + } + System.out.println(first.toString()); + System.out.println(second.toString()); + in.close(); + } +} \ No newline at end of file diff --git a/作业/刘航宇-day42/第二题/image.png b/作业/刘航宇-day42/第二题/image.png new file mode 100644 index 0000000..70fe3e0 Binary files /dev/null and b/作业/刘航宇-day42/第二题/image.png differ diff --git a/作业/刘航宇-day43/第一题/P2895.java b/作业/刘航宇-day43/第一题/P2895.java new file mode 100644 index 0000000..8e95efa --- /dev/null +++ b/作业/刘航宇-day43/第一题/P2895.java @@ -0,0 +1,51 @@ +import java.util.*; +import java.util.regex.*; + +public class P2895 { + static String normalize(String s) { + boolean neg = s.startsWith("-"); + String t = neg ? s.substring(1) : s; + int i = 0; + while (i < t.length() - 1 && t.charAt(i) == '0') i++; + t = t.substring(i); + if (t.equals("0")) neg = false; + return neg ? ("-" + t) : t; + } + + static int cmpNum(String a, String b) { + boolean na = a.startsWith("-"); + boolean nb = b.startsWith("-"); + if (na != nb) return na ? -1 : 1; + String aa = na ? a.substring(1) : a; + String bb = nb ? b.substring(1) : b; + if (!na) { + if (aa.length() != bb.length()) return aa.length() < bb.length() ? -1 : 1; + int c = aa.compareTo(bb); + return c < 0 ? -1 : (c > 0 ? 1 : 0); + } else { + if (aa.length() != bb.length()) return aa.length() > bb.length() ? -1 : 1; + int c = aa.compareTo(bb); + return c > 0 ? -1 : (c < 0 ? 1 : 0); + } + } + + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + StringBuilder input = new StringBuilder(); + while (in.hasNextLine()) { + if (input.length() > 0) input.append('\n'); + input.append(in.nextLine()); + } + Matcher m = Pattern.compile("-?\\d+").matcher(input.toString()); + List nums = new ArrayList<>(); + while (m.find()) nums.add(normalize(m.group())); + nums.sort(P2895::cmpNum); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < nums.size(); i++) { + if (i > 0) sb.append(','); + sb.append(nums.get(i)); + } + System.out.println(sb.toString()); + in.close(); + } +} \ No newline at end of file diff --git a/作业/刘航宇-day43/第一题/image.png b/作业/刘航宇-day43/第一题/image.png new file mode 100644 index 0000000..7b948cc Binary files /dev/null and b/作业/刘航宇-day43/第一题/image.png differ diff --git a/作业/刘航宇-day43/第三题/P2966.java b/作业/刘航宇-day43/第三题/P2966.java new file mode 100644 index 0000000..0397c9b --- /dev/null +++ b/作业/刘航宇-day43/第三题/P2966.java @@ -0,0 +1,27 @@ +import java.util.*; + +public class P2966 { + static long maxPrimeFactor(long n) { + if (n <= 1) return 1; + long max = -1; + while ((n & 1) == 0) { max = 2; n >>= 1; } + for (long i = 3; i * i <= n; i += 2) { + while (n % i == 0) { max = i; n /= i; } + } + if (n > 1) max = n; + return max; + } + + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + List nums = new ArrayList<>(); + while (in.hasNextLong()) nums.add(in.nextLong()); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < nums.size(); i++) { + if (i > 0) sb.append(','); + sb.append(maxPrimeFactor(nums.get(i))); + } + System.out.println(sb.toString()); + in.close(); + } +} \ No newline at end of file diff --git a/作业/刘航宇-day43/第三题/image.png b/作业/刘航宇-day43/第三题/image.png new file mode 100644 index 0000000..7b948cc Binary files /dev/null and b/作业/刘航宇-day43/第三题/image.png differ diff --git a/作业/刘航宇-day43/第二题/P2967.java b/作业/刘航宇-day43/第二题/P2967.java new file mode 100644 index 0000000..034d6cc --- /dev/null +++ b/作业/刘航宇-day43/第二题/P2967.java @@ -0,0 +1,36 @@ +import java.util.*; + +public class P2967 { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + if (!in.hasNextLong()) { in.close(); return; } + long n = in.nextLong(); + boolean neg = n < 0; + if (neg) n = -n; + StringBuilder sb = new StringBuilder(); + if (neg) sb.append('-'); + if (n == 1) { + sb.append('1'); + System.out.println(sb.toString()); + in.close(); + return; + } + long p = 2; + boolean first = true; + while (n > 1 && p * p <= n) { + while (n % p == 0) { + if (!first) sb.append('*'); + sb.append(p); + first = false; + n /= p; + } + p = (p == 2) ? 3 : (p + 2); + } + if (n > 1) { + if (!first) sb.append('*'); + sb.append(n); + } + System.out.println(sb.toString()); + in.close(); + } +} \ No newline at end of file diff --git a/作业/刘航宇-day43/第二题/image.png b/作业/刘航宇-day43/第二题/image.png new file mode 100644 index 0000000..7b948cc Binary files /dev/null and b/作业/刘航宇-day43/第二题/image.png differ diff --git a/作业/刘航宇-day44/第一题/PTable.java b/作业/刘航宇-day44/第一题/PTable.java new file mode 100644 index 0000000..5edd41d --- /dev/null +++ b/作业/刘航宇-day44/第一题/PTable.java @@ -0,0 +1,17 @@ +import java.util.*; + +public class PTable { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int n = in.nextInt(); + for (int i = 1; i <= n; i++) { + StringBuilder sb = new StringBuilder(); + for (int j = 1; j <= n; j++) { + if (j > 1) sb.append(' '); + sb.append(i * j); + } + System.out.println(sb.toString()); + } + in.close(); + } +} \ No newline at end of file diff --git a/作业/刘航宇-day44/第一题/image.png b/作业/刘航宇-day44/第一题/image.png new file mode 100644 index 0000000..832a17a Binary files /dev/null and b/作业/刘航宇-day44/第一题/image.png differ diff --git a/作业/刘航宇-day44/第三题/P2969.java b/作业/刘航宇-day44/第三题/P2969.java new file mode 100644 index 0000000..3f2d8a5 --- /dev/null +++ b/作业/刘航宇-day44/第三题/P2969.java @@ -0,0 +1,17 @@ +import java.util.*; + +public class P2969 { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int n = in.nextInt(); + for (int i = 0; i < n; i++) { + int stars = i <= n / 2 ? (2 * i + 1) : (2 * (n - i - 1) + 1); + int spaces = (n - stars) / 2; + StringBuilder row = new StringBuilder(); + for (int s = 0; s < spaces; s++) row.append(' '); + for (int k = 0; k < stars; k++) row.append('*'); + System.out.println(row.toString()); + } + in.close(); + } +} \ No newline at end of file diff --git a/作业/刘航宇-day44/第三题/image.png b/作业/刘航宇-day44/第三题/image.png new file mode 100644 index 0000000..832a17a Binary files /dev/null and b/作业/刘航宇-day44/第三题/image.png differ diff --git a/作业/刘航宇-day44/第二题/P2984.java b/作业/刘航宇-day44/第二题/P2984.java new file mode 100644 index 0000000..1e8da62 --- /dev/null +++ b/作业/刘航宇-day44/第二题/P2984.java @@ -0,0 +1,26 @@ +import java.util.*; + +public class P2984 { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int n = in.nextInt(); + List prev = new ArrayList<>(); + for (int row = 1; row <= n; row++) { + List cur = new ArrayList<>(row); + long val = 1; + for (int i = 0; i < row; i++) { + if (i == 0) val = 1; + else val = cur.get(i - 1) * (row - i) / i; + cur.add(val); + } + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < cur.size(); i++) { + if (i > 0) sb.append(' '); + sb.append(cur.get(i)); + } + System.out.println(sb.toString()); + prev = cur; + } + in.close(); + } +} \ No newline at end of file diff --git a/作业/刘航宇-day44/第二题/image.png b/作业/刘航宇-day44/第二题/image.png new file mode 100644 index 0000000..832a17a Binary files /dev/null and b/作业/刘航宇-day44/第二题/image.png differ diff --git a/作业/刘航宇-day45/第一题/P2989.java b/作业/刘航宇-day45/第一题/P2989.java new file mode 100644 index 0000000..735ad0a --- /dev/null +++ b/作业/刘航宇-day45/第一题/P2989.java @@ -0,0 +1,14 @@ +import java.util.*; + +public class P2989 { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int n = in.nextInt(); + for (int i = 0; i < n; i++) { + StringBuilder sb = new StringBuilder(); + for (int j = 0; j < n; j++) sb.append('V'); + System.out.println(sb.toString()); + } + in.close(); + } +} \ No newline at end of file diff --git a/作业/刘航宇-day45/第一题/image.png b/作业/刘航宇-day45/第一题/image.png new file mode 100644 index 0000000..8a4d4e2 Binary files /dev/null and b/作业/刘航宇-day45/第一题/image.png differ diff --git a/作业/刘航宇-day45/第三题/P2975.java b/作业/刘航宇-day45/第三题/P2975.java new file mode 100644 index 0000000..f90addc --- /dev/null +++ b/作业/刘航宇-day45/第三题/P2975.java @@ -0,0 +1,39 @@ +import java.util.*; + +public class P2975 { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + StringBuilder all = new StringBuilder(); + if (in.hasNextLine()) { + all.append(in.nextLine()); + while (in.hasNextLine()) { + all.append('\n'); + all.append(in.nextLine()); + } + } + Map cnt = new HashMap<>(); + for (int i = 0; i < all.length(); i++) { + char c = all.charAt(i); + if (c == '\r' || c == '\n') continue; + cnt.put(c, cnt.getOrDefault(c, 0) + 1); + } + char bestChar = 0; + int best = -1; + for (Map.Entry e : cnt.entrySet()) { + char c = e.getKey(); + int v = e.getValue(); + if (v > best || (v == best && c < bestChar)) { + best = v; + bestChar = c; + } + } + if (best < 0) { + System.out.println(); + System.out.println(0); + } else { + System.out.println(bestChar); + System.out.println(best); + } + in.close(); + } +} \ No newline at end of file diff --git a/作业/刘航宇-day45/第三题/image.png b/作业/刘航宇-day45/第三题/image.png new file mode 100644 index 0000000..8a4d4e2 Binary files /dev/null and b/作业/刘航宇-day45/第三题/image.png differ diff --git a/作业/刘航宇-day45/第二题/P2977.java b/作业/刘航宇-day45/第二题/P2977.java new file mode 100644 index 0000000..cdfb3e8 --- /dev/null +++ b/作业/刘航宇-day45/第二题/P2977.java @@ -0,0 +1,18 @@ +import java.util.*; + +public class P2977 { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + if (!in.hasNextInt()) { in.close(); return; } + int n = in.nextInt(); + int[] a = new int[n]; + for (int i = 0; i < n; i++) a[i] = in.nextInt(); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < n; i++) { + if (i > 0) sb.append(' '); + sb.append(a[i] + 1); + } + System.out.println(sb.toString()); + in.close(); + } +} \ No newline at end of file diff --git a/作业/刘航宇-day45/第二题/image.png b/作业/刘航宇-day45/第二题/image.png new file mode 100644 index 0000000..8a4d4e2 Binary files /dev/null and b/作业/刘航宇-day45/第二题/image.png differ diff --git a/作业/压缩包/刘航宇-day41.zip b/作业/压缩包/刘航宇-day41.zip new file mode 100644 index 0000000..ea9a1dd Binary files /dev/null and b/作业/压缩包/刘航宇-day41.zip differ