1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>
int t;
void BirdSound(int test, int tab[]);
int main()
{
    std::cin >> t;
    int* tablica = new int[t];
    for (int i = 0; i < t; i++) {
        std::cin >> tablica[i];
    }
    BirdSound(t, tablica);
}
void BirdSound(int t, int tab[]) {
    int toChange = 0;
    for (int i = 0; i < t - 1; i++) {
        if (tab[i] == tab[i + 1]) {
            tab[i + 1] = rand() % 100 + 3;
            toChange++;
        }
    }

    std::cout << toChange << std::endl;
}