题解 | #字符逆序#
字符逆序
https://www.nowcoder.com/practice/cc57022cb4194697ac30bcb566aeb47b
import java.util.Scanner; /** * 字符逆序 * I am a student */ public class StringReverse { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); while (scanner.hasNext()) { String nextLine = scanner.nextLine(); char[] charArray = nextLine.toCharArray(); for (int i = nextLine.length() - 1; i >= 0; i--) { System.out.print(charArray[i]); } System.out.println(); } } }