思路 交换结果只有两种,鸡左或鸡右,两种同时进行,取其中最小值输出即可 代码import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;public class Main { public static void main(String[] args) throws IOException { BufferedReader b = new BufferedReader(new InputStreamReader(System.in)); char[] all ...