解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class C1000 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int n = sc.nextInt(); char[] chs = sc.next().toCharArray(); F(chs, 0, n-1); } sc.close(); } private static void F(char[] chs, int start, int end){ if(start >= end) System.out.println("\n" + String.valueOf(chs)); else{ char temp = chs[start]; chs[start] = chs[end]; chs[end] = temp; System.out.println(String.valueOf(chs)); F(chs, start+1, end-1); } } }
0.0分
3 人评分
买不到的数目 (C++代码)浏览:867 |
2003年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:541 |
数组输出 (C语言代码)错误???浏览:563 |
C语言训练-数字母 (C语言代码)浏览:649 |
C语言程序设计教程(第三版)课后习题6.5 (C++代码)浏览:449 |
C语言程序设计教程(第三版)课后习题6.3 (C语言代码)from DQM浏览:662 |
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:562 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:537 |
1025题解浏览:736 |
简单的a+b (C语言代码)浏览:478 |