The random number of the Ming

Source: Internet
Author: User

1#include <stdio.h>2#include <string.h>3#include <stdlib.h>4 intmpintLenint*str)5 {6    intMNT =0;7    int*newstr = (int*)malloc(sizeof(int)*len);8     for(inti =0; I < Len-1; i++)9    {Ten         for(intj =0; J < Len-1-i;j++) One        { A            if(Str[j] > str[j+1]) -            { -MNT =Str[j]; theSTR[J] = str[j+1]; -str[j+1] =mnt; -            } -        } +    } -     for(inti =0; I < len;i++) +    { ANewstr[i] =Str[i]; at    } -memset (str,0,sizeof(int)*len); -    intj =0; -     for(inti =0; I < len-1; i++) -    { -        if(Newstr[i]! = newstr[i+1]) in        { -STR[J] =Newstr[i]; toJ + +; +        } -    } theSTR[J] = Newstr[len-1]; *     Free(NEWSTR); $    returnJ;Panax Notoginseng } - intMain () the { +     intnum; A     intJ; the     intst1[ +]; +memset (St1,0,sizeof(ST1)); -      while(Fscanf (stdin,"%d", &num)! =EOF) $     { $          for(inti =0; I < num;i++) -         { -FSCANF (stdin,"%d",&st1[i]); the         } -         //bubblingWuyij =MP (NUM,ST1); the          for(intI=0; I < j+1; i++) -printf"%d\n", St1[i]); Wu     } -     return 0; About}

Title Description

Obviously want to ask some students in school to do a questionnaire survey, in order to the objectivity of the experiment, he first used a computer to generate N 1 to 1000 random integer (n≤1000), for the repeated numbers, only one, the rest of the same number is removed, the different numbers correspond to different student's number. Then the numbers from small to large sorting, in line with the order to find students to do the investigation. Please help clearly to complete the "go to Heavy" and "sort" work.

Input Param

N Enter the number of random numbers

Inputarray an array of n random integers

Return Value

Outputarray random integer after output processing


Note: The test case guarantees the correctness of the input parameters and the answer does not need to be verified. There are more than one set of test cases.



Input Description:

Enter multiple lines, first enter the number of random integers, and then enter the corresponding number of integers



Output Description:

Returns multiple rows, processed results


Input Example:
11102040326740208930040015

Output Example:
10152032406789300400

The random number of the Ming

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.