题目1:切糖果 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); while (in.hasNextInt()) { int n = in.nextInt(); // 糖果的长度 int[] arr = new int[n]; // 糖果每一段的口味 for (int i = 0; ...