Your school NIT. Number of forgotten items ., School nit forgotten
Forgotten number of Time limit: 1000 MS Memory limit: 32768 K
Total Submit: 1817 Accepted: 1059
Give you the number of N-1 in... N, which number is output is forgotten.
Enter N in the first line, and there is a N-1 line below, each row is a number. (1 <N <16)
Output The Forgotten number in each row.
Sample Input
3124234
Sample Output
31
The number of forgotten people disappears forever,
On the code.
# Include <stdio. h> int main () {int n, m; while (scanf ("% d", & n )! = EOF) {int a [20] = {0}; int I, wbx; for (I = 1; I <= n-1; I ++) {scanf ("% d", & m); a [m] ++; // Save the number that has not been forgotten to the array. The value is 1.
} For (I = 1; I <= n; I ++) {if (! A [I]) // If a [I] = 0, this number is forgotten. {Wbx = I; // assign the forgotten number variable to wbx. break;} printf ("% d \ n", wbx); // output .} Return 0 ;}