新手,请问在Java中怎么把一句中文到过来输出,就是把“我是中国人”到倒过来为“人国中是我”
import *;import java.util.Scanner;
public class TestReverse{
public static void main(String args[]){
try{
Scanner input=new Scanner(System.in);
System.out.println("输入:");
String str=input.next();
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
str=br.readLine();
char ch[]=new char[str.length()];
ch=str.toCharArray();
for(int i=ch.length-1;i>=0;i--){
System.out.print(ch[i]);
}
}catch(IOException e){}
}
}这样只能针对英文