解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); String s = sc.next(); char c[] = s.toCharArray(); for (int i = 0; i < c.length / 2; i++) { char t = c[i]; c[i] = c[c.length - 1 - i]; c[c.length - 1 - i] = t; for (int j = 0; j < c.length; j++) System.out.print(c[j]); System.out.println(); } System.out.println(); for (int j = 0; j < c.length; j++) System.out.print(c[j]); } }
0.0分
1 人评分