题解 | #按照格式输入并交换输出#
按照格式输入并交换输出
http://www.nowcoder.com/practice/95eb723a3e854376a7eb6d116cc7d875
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String twoNums = in.nextLine();
String[] nums = twoNums.split(",");//将a,b分隔开
System.out.println(nums[0].substring(0,2) + nums[1].substring(2) + "," + nums[1].substring(0,2) + nums[0].substring(2));//利用子字符串直接输出
}
}