diff --git a/bin/Main.class b/bin/Main.class index a68ba83..3ec49de 100644 Binary files a/bin/Main.class and b/bin/Main.class differ diff --git a/exercise/src/Main.class b/exercise/src/Main.class index 814daa6..2eeb10c 100644 Binary files a/exercise/src/Main.class and b/exercise/src/Main.class differ diff --git a/exercise/src/Main.java b/exercise/src/Main.java index 412c35e..17094df 100644 --- a/exercise/src/Main.java +++ b/exercise/src/Main.java @@ -3,8 +3,14 @@ import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); - int n = in.nextInt(); - System.out.println(n % 3 == 0 ? "hua" : "ming"); + String s = in.nextLine(); + String[] words = s.split(" "); + StringBuilder sb = new StringBuilder(s.length()); + for (int i = words.length - 1; i >= 0; i--) { + sb.append(words[i]); + if (i > 0) sb.append(' '); + } + System.out.println(sb.toString()); in.close(); } } \ No newline at end of file diff --git a/作业/作业/刘航宇-day38/第一题/Main.java b/作业/作业/刘航宇-day38/第一题/Main.java new file mode 100644 index 0000000..c11f94d --- /dev/null +++ b/作业/作业/刘航宇-day38/第一题/Main.java @@ -0,0 +1,15 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String s = in.nextLine(); + StringBuilder out = new StringBuilder(s.length()); + for (int i = 0; i < s.length(); i++) { + char c = s.charAt(i); + if (((int)c & 1) == 1) out.append(c); + } + System.out.println(out.toString()); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day38/第一题/image.png b/作业/作业/刘航宇-day38/第一题/image.png new file mode 100644 index 0000000..4c2ca35 Binary files /dev/null and b/作业/作业/刘航宇-day38/第一题/image.png differ diff --git a/作业/作业/刘航宇-day38/第三题/Main.java b/作业/作业/刘航宇-day38/第三题/Main.java new file mode 100644 index 0000000..40004fc --- /dev/null +++ b/作业/作业/刘航宇-day38/第三题/Main.java @@ -0,0 +1,25 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int x = Integer.parseInt(in.nextLine().trim()); + int q = Integer.parseInt(in.nextLine().trim()); + for (int i = 0; i < q; i++) { + String line = in.nextLine().trim(); + String[] parts = line.split(" "); + int p = Integer.parseInt(parts[0]); + long t = Long.parseLong(parts[1]); + double ans; + if (p == 1) { + ans = t * (60.0 - x); + } else if (p == 2) { + ans = 3600.0 * t / (60.0 - x); + } else { + ans = (12.0 * 3600.0 * 60.0 * t) / x; + } + System.out.printf("%.2f\n", ans); + } + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day38/第三题/image.png b/作业/作业/刘航宇-day38/第三题/image.png new file mode 100644 index 0000000..3c50bfd Binary files /dev/null and b/作业/作业/刘航宇-day38/第三题/image.png differ diff --git a/作业/作业/刘航宇-day38/第二题/Main.java b/作业/作业/刘航宇-day38/第二题/Main.java new file mode 100644 index 0000000..40004fc --- /dev/null +++ b/作业/作业/刘航宇-day38/第二题/Main.java @@ -0,0 +1,25 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int x = Integer.parseInt(in.nextLine().trim()); + int q = Integer.parseInt(in.nextLine().trim()); + for (int i = 0; i < q; i++) { + String line = in.nextLine().trim(); + String[] parts = line.split(" "); + int p = Integer.parseInt(parts[0]); + long t = Long.parseLong(parts[1]); + double ans; + if (p == 1) { + ans = t * (60.0 - x); + } else if (p == 2) { + ans = 3600.0 * t / (60.0 - x); + } else { + ans = (12.0 * 3600.0 * 60.0 * t) / x; + } + System.out.printf("%.2f\n", ans); + } + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day38/第二题/image.png b/作业/作业/刘航宇-day38/第二题/image.png new file mode 100644 index 0000000..e69de29 diff --git a/作业/作业/刘航宇-day39/第一题/Main.java b/作业/作业/刘航宇-day39/第一题/Main.java new file mode 100644 index 0000000..6ded2ba --- /dev/null +++ b/作业/作业/刘航宇-day39/第一题/Main.java @@ -0,0 +1,11 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + long n = in.nextLong(); + long ans = n * (n + 1) * (n + 2) / 6; + System.out.println(ans); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day39/第一题/image.png b/作业/作业/刘航宇-day39/第一题/image.png new file mode 100644 index 0000000..73f81c8 Binary files /dev/null and b/作业/作业/刘航宇-day39/第一题/image.png differ diff --git a/作业/作业/刘航宇-day39/第三题/Main.java b/作业/作业/刘航宇-day39/第三题/Main.java new file mode 100644 index 0000000..17094df --- /dev/null +++ b/作业/作业/刘航宇-day39/第三题/Main.java @@ -0,0 +1,16 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String s = in.nextLine(); + String[] words = s.split(" "); + StringBuilder sb = new StringBuilder(s.length()); + for (int i = words.length - 1; i >= 0; i--) { + sb.append(words[i]); + if (i > 0) sb.append(' '); + } + System.out.println(sb.toString()); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day39/第三题/image.png b/作业/作业/刘航宇-day39/第三题/image.png new file mode 100644 index 0000000..519e817 Binary files /dev/null and b/作业/作业/刘航宇-day39/第三题/image.png differ diff --git a/作业/作业/刘航宇-day39/第二题/Main.java b/作业/作业/刘航宇-day39/第二题/Main.java new file mode 100644 index 0000000..53a2d05 --- /dev/null +++ b/作业/作业/刘航宇-day39/第二题/Main.java @@ -0,0 +1,19 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String s1 = in.nextLine(); + String s2 = in.nextLine(); + int idx = s1.indexOf(s2); + String ans; + if (idx == -1) { + ans = s1; + } else { + ans = s1.substring(0, idx) + s1.substring(idx + s2.length()); + } + if (ans.length() == 0) System.out.println("null"); + else System.out.println(ans); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day39/第二题/image.png b/作业/作业/刘航宇-day39/第二题/image.png new file mode 100644 index 0000000..0b35843 Binary files /dev/null and b/作业/作业/刘航宇-day39/第二题/image.png differ diff --git a/作业/压缩包/刘航宇-day38.zip b/作业/压缩包/刘航宇-day38.zip new file mode 100644 index 0000000..a13600f Binary files /dev/null and b/作业/压缩包/刘航宇-day38.zip differ diff --git a/作业/压缩包/刘航宇-day39.zip b/作业/压缩包/刘航宇-day39.zip new file mode 100644 index 0000000..0f67fa9 Binary files /dev/null and b/作业/压缩包/刘航宇-day39.zip differ