Java用Character的toString()方法来把获取的各个字符重新拼接
反序输出
http://www.nowcoder.com/questionTerminal/171278d170c64d998ab342b3b40171bb
package demo.day0202; import java.util.List; import java.util.Scanner; public class clien { public static void main(String[] args) { Scanner sc=new Scanner(System.in); char c1,c2,c3,c4; String temp; while (sc.hasNext()){ temp=sc.nextLine(); c1=temp.charAt(0); c2=temp.charAt(1); c3=temp.charAt(2); c4=temp.charAt(3); temp=Character.toString(c4)+Character.toString(c3)+Character.toString(c2)+Character.toString(c1); System.out.println(temp); } } }