字符串倒续排列的小程序
2011-06-08 15:16
197 查看
public class Sort {
public static void main(String[] args) {
String str = "china";
char[] s = str.toCharArray();
int i=s.length;
String newstr="";
for (int h = i-1; h >=0; h--)
{
newstr+=s[h]+"";
}
System.out.println(newstr);
}
}
public static void main(String[] args) {
String str = "china";
char[] s = str.toCharArray();
int i=s.length;
String newstr="";
for (int h = i-1; h >=0; h--)
{
newstr+=s[h]+"";
}
System.out.println(newstr);
}
}
相关文章推荐
- 编写一个程序,输入一串不超过60个字符组成的且不包含换行符的字符串,将字符串中的A到Z的字母按英文字典字母顺序重新排列,排列后的单词的长度要与原始句子中的长度相同,并且要求只对A到Z的字母重新排列,其
- 一个打印输入字符串所有排列的递归程序
- 字符串的全排列程序
- PHP中数组转换成json字符串程序代码
- MVC3出现“提供程序未返回 ProviderManifestToken 字符串”的解决办法
- 字符串的全排列和组合算法
- c#中分割字符串(简单程序)
- Java 程序优化:字符串操作、基本运算方法等优化策略(一)
- 剑指offer系列之26:字符串的排列
- Android定义字符串数组资源并在程序中使用
- 计算字符串的程序优化
- 字符串的全排列和组合算法
- 编写一个程序,这个程序把一个整数数组中的每个元素用逗号连接成一个字符串,例如,根 据内容为[1][2][3]的数组形成内容为"1,2,3"的字符串。
- 字符串的排列
- 试编写一个程序,输入一个字符串,统计其中有多少各单词?单词之间用空格分开
- python基础编程_21_递归 :字符串元素的倒序排列, 4000 求年龄
- 从键盘输入字符串并输出该字符串(汇编程序—I/O
- 字符串的排列
- 字符串的排列
- 【剑指Offer面试编程题】题目1369:字符串的排列--九度OJ