我第一题这么写的,只有40%,是输入输出的问题么😥 import java.util.Scanner; public class NetEase2 { public static void main(String[] args) { Scanner in = new Scanner(System.in); while(in.hasNextLine()){ String[] nums = in.nextLine().split(" "); String sumStr = in.nextLine(); int sum = Integer.parseInt(sumStr); int count = 0; for (int i = 0; i < nums.length - 1; i++) { for (int j = i + 1; j < nums.length; j++) { if (Integer.parseInt(nums[i]) + Integer.parseInt(nums[j]) < sum) { count++; } } } System.out.println(count); } } }