Your school NIT. Number of forgotten items ., School nit forgotten

Source: Internet
Author: User

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
Sample Output


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 ;}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.