This commit is contained in:
2025-12-20 21:57:38 +08:00
parent befba62cf6
commit 43fecdd294
17 changed files with 119 additions and 2 deletions
BIN
View File
Binary file not shown.
Binary file not shown.
+8 -2
View File
@@ -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();
}
}
@@ -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();
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

@@ -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();
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

@@ -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();
}
}
@@ -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();
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

@@ -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();
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

@@ -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();
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.
Binary file not shown.