Xiaomi company programming question 2 (Welcome to criticize and correct)

Source: Internet
Author: User

2. Number of special characters
In an array with a length of N, all the other three numbers appear twice. Write the program to find any number.
For example
1 3 7 9 5 5 9 4 3 6 1 7
Output

4/5/6

/*************************************** * ******************************** // * The length is n in the array, except for three numbers, the others appear twice, write the program and find any *//******************************** **************************************** /# include <stdio. h> # define n 12int main (void) {int input [] = {,}; // int result [N]; int temp [N]; int I; // all temp arrays are initialized to 0for (I = 0; I <n; I ++) {temp [I] = 0 ;} for (I = 0; I <n; I ++) {If (temp [input [I] = 0) {temp [input [I] = 1 ;} else {temp [input [I] = 2 ;}} for (I = 0; I <n; I ++) {If (temp [I] = 1) {printf ("% d", I) ;}} return 0 ;}

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: info-contact@alibabacloud.com 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.