解题思路:
注意事项:
参考代码:
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 人评分
C语言程序设计教程(第三版)课后习题5.8 (C语言代码)浏览:758 |
C语言训练-数字母 (C语言代码)浏览:582 |
C语言程序设计教程(第三版)课后习题9.2 (Java代码)浏览:608 |
WU-C语言程序设计教程(第三版)课后习题12.1 (C++代码)浏览:919 |
C语言程序设计教程(第三版)课后习题6.8 (C语言代码)浏览:522 |
The 3n + 1 problem (C语言代码)浏览:548 |
回文数字 (C语言代码)浏览:2509 |
数字游戏 (C++代码)浏览:1177 |
蚂蚁感冒 (C语言代码)浏览:768 |
杨辉三角 (C语言代码)浏览:676 |