题解 | #序列找数#
序列找数
http://www.nowcoder.com/practice/a7d1856a72404ea69fdfb5786d65539c
代码实现:
public class Main {
public static void main(String[] args) throws Exception{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int sum = 0;
while(sc.hasNext()) sum += sc.nextInt();
System.out.println((1 + n)*n/2 - sum);
}
}