题解 | #按照格式输入并交换输出#
按照格式输入并交换输出
https://www.nowcoder.com/practice/95eb723a3e854376a7eb6d116cc7d875
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String input = scanner.nextLine();
String[] parts = input.split(",");
int a = Integer.parseInt(parts[0].split("=")[1]);
int b = Integer.parseInt(parts[1].split("=")[1]);
int temp = a;
a = b;
b = temp;
System.out.println("a=" + a + ",b=" + b);
}
}
海康威视公司福利 1330人发布