#include
#include
int main (int argc, char *argv[])
{
const int N = 18;
int A[N], i = 0;
while(i < N)
{
printf("A[%d] = ",++i);
scanf("%d", &A[i-1]);
}
i = 0;
while(A[i]==A[i+1])
i++;
printf("k = %d",++i);
getch();
}
Пример работы программы:
A[1] = 1
A[2] = 1
A[3] = 1
A[4] = 1
A[5] = 1
A[6] = 1
A[7] = 3
A[8] = 4
A[9] = 5
A[10] = 6
A[11] = 4
A[12] = 5841
A[13] = 65
A[14] = 63
A[15] = 56
A[16] = 5
A[17] = 8
A[18] = 6
k = 6