package lianxi; import java.util.*; public class Main { public static void main(String args[]) { Scanner scan = new Scanner(System.in); String line; while (scan.hasNextLine()) { line = scan.nextLine().trim(); List<String> list = Arrays.asList(line.split(","));///返回由指定数组支持的固定大小的列表。 int i = 1; while (true){ if(!list.contains(i+"")){///判断是否包含某元素 break; } i++; } System.out.println(i); } } }