include stdio include stdlib include string void qwe int mas size_t co

 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
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void qwe(int * mas, size_t * count) {
int * ph=NULL, * pt;
for ( ph = mas; ( *count - ( ph - mas ) ) > 1; ++ph )
{for ( pt = mas + *count - 1; pt > ph; --pt ) {
if ( *pt == *ph ) {
*count -= 1;
memmove(pt, pt + 1, sizeof(int) * ( *count - ( pt - mas ) ));
}}}}
void asd(const int * mas, size_t count) {
while ( count-- )
printf("%d%c", *mas++, ( count ) ? ' ' : '\n');
}
int main(void) {
int M[10],i;
size_t count;
for(i=0;i<10;i++)
scanf("%d",&M[i]);
for ( count = 0; count < 10; ++count );
printf("elements\nBefore: ");
asd(M, count);
qwe(M, &count);
printf("After: ");
asd(M, count);
return 0;
}