Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    if(a == b && b == c) {
        cout << -1 << endl;
        return 0;
    }
    int ans = 0;
    int a[1000], b[1000], c[1000];
    a[0] = a;  b[0] = b;  c[0] = c;

    int i = 0;
    while(a[i]%2 == 1 || b[i]%2 == 1 || c[i]%2 == 1) {
        a[i+1] = (b[i] + c[i])/2;
        b[i+1] = (c[i] + a[i])/2;
        c[i+1] = (a[i] + b[i])/2;
        ans++;
    }

    cout << ans;
    
    cout << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: conflicting declaration 'int a [1000]'
   19 |     int a[1000], b[1000], c[1000];
      |         ^
a.cc:12:9: note: previous declaration as 'int a'
   12 |     int a, b, c;
      |         ^
a.cc:19:18: error: conflicting declaration 'int b [1000]'
   19 |     int a[1000], b[1000], c[1000];
      |                  ^
a.cc:12:12: note: previous declaration as 'int b'
   12 |     int a, b, c;
      |            ^
a.cc:19:27: error: conflicting declaration 'int c [1000]'
   19 |     int a[1000], b[1000], c[1000];
      |                           ^
a.cc:12:15: note: previous declaration as 'int c'
   12 |     int a, b, c;
      |               ^
a.cc:20:6: error: invalid types 'int[int]' for array subscript
   20 |     a[0] = a;  b[0] = b;  c[0] = c;
      |      ^
a.cc:20:17: error: invalid types 'int[int]' for array subscript
   20 |     a[0] = a;  b[0] = b;  c[0] = c;
      |                 ^
a.cc:20:28: error: invalid types 'int[int]' for array subscript
   20 |     a[0] = a;  b[0] = b;  c[0] = c;
      |                            ^
a.cc:23:12: error: invalid types 'int[int]' for array subscript
   23 |     while(a[i]%2 == 1 || b[i]%2 == 1 || c[i]%2 == 1) {
      |            ^
a.cc:23:27: error: invalid types 'int[int]' for array subscript
   23 |     while(a[i]%2 == 1 || b[i]%2 == 1 || c[i]%2 == 1) {
      |                           ^
a.cc:23:42: error: invalid types 'int[int]' for array subscript
   23 |     while(a[i]%2 == 1 || b[i]%2 == 1 || c[i]%2 == 1) {
      |                                          ^
a.cc:24:10: error: invalid types 'int[int]' for array subscript
   24 |         a[i+1] = (b[i] + c[i])/2;
      |          ^
a.cc:24:20: error: invalid types 'int[int]' for array subscript
   24 |         a[i+1] = (b[i] + c[i])/2;
      |                    ^
a.cc:24:27: error: invalid types 'int[int]' for array subscript
   24 |         a[i+1] = (b[i] + c[i])/2;
      |                           ^
a.cc:25:10: error: invalid types 'int[int]' for array subscript
   25 |         b[i+1] = (c[i] + a[i])/2;
      |          ^
a.cc:25:20: error: invalid types 'int[int]' for array subscript
   25 |         b[i+1] = (c[i] + a[i])/2;
      |                    ^
a.cc:25:27: error: invalid types 'int[int]' for array subscript
   25 |         b[i+1] = (c[i] + a[i])/2;
      |                           ^
a.cc:26:10: error: invalid types 'int[int]' for array subscript
   26 |         c[i+1] = (a[i] + b[i])/2;
      |          ^
a.cc:26:20: error: invalid types 'int[int]' for array subscript
   26 |         c[i+1] = (a[i] + b[i])/2;
      |                    ^
a.cc:26:27: error: invalid types 'int[int]' for array subscript
   26 |         c[i+1] = (a[i] + b[i])/2;
      |                           ^