Language: C++

#include <iostream>
#include <numeric>
using namespace std;






int main(){
int t ;
int count = 0;



// for reading in values
int a;
int b;

  cin >> t ;
  int* arrayT = new int[t];
  int* arrayA = new int[t];

  while (count < t){
    cin >> a >> b;
   arrayT[count] = a;
   arrayA[count] = b;
   count++;
  }
//current number of votes for t and a

int Tvotes;

  int Avotes;

  Tvotes = arrayT[0];
  Avotes = arrayA[0];
// votes cannot decrease can only increase

// loop thru all the steps
  for(int a = 1; a < t ; a++ ){
int currA = arrayA[a];
int prevA = Avotes;
int currT = arrayT[a];
int prevT = Tvotes;




// true is t is bigger false is a bigger
bool currW = (currT >= currA)? true : false;
bool prevW = (prevT >= prevA)? true : false;

if(currT == currA){
    if(prevW){
      Avotes = Tvotes;
      continue;
    }
  else{
    Tvotes = Avotes;
    continue;
  }
}

double DcurrA = arrayA[a];
double DprevA = Avotes;
double DcurrT = arrayT[a];
double DprevT = Tvotes;

bool TTT = (currT >= Tvotes)? true : false;
bool AAA = (currA >= Avotes)? true : false;


double Tratio = DprevT / DcurrT;
double Aratio = DprevA / DcurrA;

if(Tratio > Aratio){
  for (int a = 1; Tratio; a++){
    if (currT * a >= Tvotes){
      Avotes = currA * a;
      Tvotes = currT * a;
      break;
      }
      continue;
}
else{
  for (int a = 1; Tratio; a++){
    if (currA * a >= Avotes){
      Avotes = currA * a;
      Tvotes = currT * a;
      break;
      }
      continue;
}
}

}

if (!TTT || !AAA){
if(!TTT){
  for (int a = 1; !TTT; a++){
    if (currT * a >= Tvotes){
      Avotes = currA * a;
      Tvotes = currT * a;
      break;
      }
      continue;
}
}

if(!AAA){
  for (int a = 1; !AAA; a++){
    if (currA * a >= Avotes){
      Avotes = currA * a;
      Tvotes = currT * a;
      break;
      }
      continue;
}
}
}
// if t is greater mess with a
if(currW) {
  for (int a = 1; currW; a++){
    if (currA * a >= Avotes){
      Avotes = currA * a;
      Tvotes = currT * a;
      break;
      }

  }
continue;
}else{
  for (int a = 1; !currW; a++){
    if (currT * a >= Tvotes){
      Avotes = currA * a;
      Tvotes = currT * a;
      break;
    }
  }
continue;}



// when both are more than before, u add em, so the same
if (TTT && AAA){
  Avotes = currA;
  Tvotes = currT;
  continue;
}


  }

cout << Avotes + Tvotes;
delete[] arrayT;
delete[] arrayA;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:86:1: error: expected '}' before 'else'
   86 | else{
      | ^~~~
a.cc:77:20: note: to match this '{'
   77 | if(Tratio > Aratio){
      |                    ^
a.cc:99:6: error: 'TTT' was not declared in this scope
   99 | if (!TTT || !AAA){
      |      ^~~
a.cc:99:14: error: 'AAA' was not declared in this scope
   99 | if (!TTT || !AAA){
      |              ^~~
a.cc:102:9: error: 'currT' was not declared in this scope
  102 |     if (currT * a >= Tvotes){
      |         ^~~~~
a.cc:103:16: error: 'currA' was not declared in this scope
  103 |       Avotes = currA * a;
      |                ^~~~~
a.cc:113:9: error: 'currA' was not declared in this scope
  113 |     if (currA * a >= Avotes){
      |         ^~~~~
a.cc:115:16: error: 'currT' was not declared in this scope
  115 |       Tvotes = currT * a;
      |                ^~~~~
a.cc:123:4: error: 'currW' was not declared in this scope
  123 | if(currW) {
      |    ^~~~~
a.cc:125:9: error: 'currA' was not declared in this scope
  125 |     if (currA * a >= Avotes){
      |         ^~~~~
a.cc:127:16: error: 'currT' was not declared in this scope
  127 |       Tvotes = currT * a;
      |                ^~~~~
a.cc:132:1: error: continue statement not within a loop
  132 | continue;
      | ^~~~~~~~
a.cc:135:9: error: 'currT' was not declared in this scope
  135 |     if (currT * a >= Tvotes){
      |         ^~~~~
a.cc:136:16: error: 'currA' was not declared in this scope
  136 |       Avotes = currA * a;
      |                ^~~~~
a.cc:141:1: error: continue statement not within a loop
  141 | continue;}
      | ^~~~~~~~
a.cc:146:5: error: 'TTT' was not declared in this scope
  146 | if (TTT && AAA){
      |     ^~~
a.cc:146:12: error: 'AAA' was not declared in this scope
  146 | if (TTT && AAA){
      |            ^~~
a.cc:147:12: error: 'currA' was not declared in this scope
  147 |   Avotes = currA;
      |            ^~~~~
a.cc:148:12: error: 'currT' was not declared in this scope
  148 |   Tvotes = currT;
      |            ^~~~~
a.cc:149:3: error: continue statement not within a loop
  149 |   continue;
      |   ^~~~~~~~
a.cc: At global scope:
a.cc:155:1: error: 'cout' does not name a type
  155 | cout << Avotes + Tvotes;
      | ^~~~
a.cc:156:1: error: expected unqualified-id before 'delete'
  156 | delete[] arrayT;
      | ^~~~~~
a.cc:157:1: error: expected unqualified-id before 'delete'
  157 | delete[] arrayA;
      | ^~~~~~
a.cc:158:3: error: expected unqualified-id before 'return'
  158 |   return 0;
      |   ^~~~~~
a.cc:159:1: error: expected declaration before '}' token
  159 | }
      | ^