include stdio include stdlib include math define 10 int main int argc

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define N 10
int main(int argc, char *argv[])
{
int m[N];
int i,j,k,t,z,x,q;
q=0;
k=N;
t=1;
printf("Vvedite massive\n");
for (i=0;i<N;i++)
scanf("%d", &m[i]);
printf("\n");
for (i=0;i<N;i++)
if (m[i]==m[i+1]) q++;
x=m[0];
while (t<=N)
{ for (i=0; i<k; i++)
for (j=i+1; j<k-1; j++)
if (m[j]==m[i])
{for (z=j; z<k-1; z++)
m[z]=m[z+1];
k--;
}
t++;
}
if (m[0]==m[1])
{for (i=0; i<k; i++)
m[i]=m[i+1];
k--;
}
if (m[k-2]==m[k-1])
k--;
if (m[0]==m[k-1])
k--;
for (i=0; i<k; i++)
printf("%d\n", m[i]);
if (q==N-1) printf("%d\n", x);
printf("\n");
system ("PAUSE");
return 0;
}