输入QianRuShi输出QRS Java
时间: 2024-05-02 21:18:30 浏览: 93
代码如下:
```java
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String input = sc.nextLine();
String output = "";
for (int i = 0; i < input.length(); i++) {
char c = input.charAt(i);
if (c == 'Q') {
output += "Q";
} else if (c == 'i') {
output += "I";
} else if (c == 'a') {
output += "A";
} else if (c == 'n') {
output += "N";
} else if (c == 'R') {
output += "R";
} else if (c == 'u') {
output += "U";
} else if (c == 'S') {
output += "S";
} else if (c == 'h') {
output += "H";
}
}
System.out.println(output);
}
}
```
阅读全文