解题思路:
注意事项:
参考代码:
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语言训练-求s=a+aa+aaa+aaaa+aa...a的值 (C语言代码)浏览:1040 |
【密码】 (C语言代码)浏览:333 |
【亲和数】 (C语言代码)浏览:495 |
兰顿蚂蚁 (C++代码)浏览:1110 |
数组输出 (C语言代码)错误???浏览:570 |
淘淘的名单 (C语言代码)答案错误???浏览:595 |
【偶数求和】 (C语言代码)浏览:652 |
sizeof的大作用 (C语言代码)浏览:1050 |
C语言程序设计教程(第三版)课后习题9.6 (C语言代码)浏览:589 |
C语言程序设计教程(第三版)课后习题11.1 (C语言代码)浏览:489 |