Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C by Fimor ( 12 years ago )
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
int i, j, n;
int a[100];
do {
printf("vvedite razmer massiva:");
scanf("%i", &n);
} while (n < 3);
for (i = 0; i < n; i++) {
printf("a[%i]=", i+1);
scanf("%i", &a[i]);
}
for (i = 1; i <= n; i++) {
if (a[i] == a[i - 1]) {
n -= 2;
for (j = i - 1; j < n; j++) {
a[j] = a[j + 2];
}
i = 0;
}
}
printf("razmer massiva:%i", n);
for (i = 0; i < n; i++) {
printf("\na[%i]=%i", i + 1, a[i]);
}
return 0;
}
Revise this Paste