1117 one communication

Description [title]

Given contains n sequences of n integers, the requirements of the sequence to re-operate. The so-called de-emphasis, is the number of this sequence is repeated for each, retaining only the position of the first occurrence of the number, delete the rest position.

[Enter]

Input contains two lines:

The first line contains a positive integer n- ( . 1 n- 20000 ) n-(1≤n≤20000), the second row indicates the number of digits in the sequence;

The second line contains n- n-integers, separated by a space between integers. Each equal to an integer greater than 10 10 or less 5000 5000.

[Output]

Only a single line output, wherein the output will not be repeated in the order of the digital input, and a space between the integer.

[Sample input]

5
10 12 93 12 75

[Sample Output]

10 12 93 75

#include <the iostream>
#include <cstdio>
#include <the cmath>
#include <CString>
the using namespace STD;
int main ()
{
int n-;
n-CIN >>;
int A [n-];
for (int I = 0; I <n-; I ++)
{
CIN >> A [I];
}
for (int I = 0; I <n-; I ++)
{
for (int J = I +. 1; J <n-; J ++)
{
IF (A [ I] == a [J])
a [J] = 0; // since it is not an integer number variable becomes spaces, so that the number of repeating the first 0 =
}
}
for (int I = 0; I <n- ; I ++)
{
IF (a [I] == 0) // this is the details of the operation will be repeated the number of skipped, the next cycle begins, so that the space equivalent
Continue;
COUT << a [I] << "";
}
return 0;
}

Guess you like

Origin www.cnblogs.com/57xmz/p/12244452.html