题解 | #字符逆序#
字符逆序
https://www.nowcoder.com/practice/cc57022cb4194697ac30bcb566aeb47b
import java.util.Scanner; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; // 注意类名必须为 Main, 不要有任何 package xxx 信息 public class Main { public static void main(String[] args) throws IOException { Scanner scanner = new Scanner(System.in); InputStreamReader inputStreamReader=new InputStreamReader(System.in); BufferedReader br=new BufferedReader(inputStreamReader); String line = br.readLine(); StringBuilder stringBuilder = new StringBuilder(line); StringBuilder reverse = stringBuilder.reverse(); System.out.println(reverse.toString()); } }