题解 | #按照格式输入并交换输出#
按照格式输入并交换输出
https://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 s = in.next(); String[] ss = s.split(","); String a,b; b = ss[0].substring(ss[0].substring(0,ss[0].indexOf("=")).length()+1); a = ss[1].substring(ss[1].substring(0,ss[1].indexOf("=")).length()+1); System.out.print("a="+a+",b="+b); } }