Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
int N;
  cin >> N;
  vector <int> A(i);
  for(int i=0;i<N;i++){
    cin >>A(i);
  }
  sort(A.begin(),A.end());
  vector <int> result1;
  vector <int> result2;
  for(int i=1 i<A(0);i++){
    if(A(0)%i==0){
      result1.push_back(i);
    }
  }
  for(int i=1 i<A(1);i++){
    if(A(1)%i==0){
      result2.push_back(i);
    }
  }
  int count1=0
  int yakusuu1;
  for(int i=result1.size();i>0;i--){
    for(int j=0;j<N;j++){
      if(A(j)%result1(i)==0){
        count1++;
      }
    }
    if(count1==N){
      yakusuu1 = result1(i);
      break;
    }
    count1=0;
  }
  int count2=0
  int yakusuu2;
  for(int i=result2.size();i>0;i--){
    for(int j=0;j<N;j++){
      if(A(j)%result2(i)==0){
        count2++;
      }
    }
    if(count2==N){
      yakusuu2 = result2(i);
      break;
    }
    count2=0;
  }  
  if(result1<result2){
    result1=result2;
  }
 
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: 'i' was not declared in this scope
    9 |   vector <int> A(i);
      |                  ^
a.cc:11:12: error: no match for call to '(std::vector<int>) (int&)'
   11 |     cin >>A(i);
      |           ~^~~
a.cc:16:14: error: expected ';' before 'i'
   16 |   for(int i=1 i<A(0);i++){
      |              ^~
      |              ;
a.cc:16:18: error: no match for call to '(std::vector<int>) (int)'
   16 |   for(int i=1 i<A(0);i++){
      |                 ~^~~
a.cc:17:9: error: no match for call to '(std::vector<int>) (int)'
   17 |     if(A(0)%i==0){
      |        ~^~~
a.cc:21:14: error: expected ';' before 'i'
   21 |   for(int i=1 i<A(1);i++){
      |              ^~
      |              ;
a.cc:21:18: error: no match for call to '(std::vector<int>) (int)'
   21 |   for(int i=1 i<A(1);i++){
      |                 ~^~~
a.cc:22:9: error: no match for call to '(std::vector<int>) (int)'
   22 |     if(A(1)%i==0){
      |        ~^~~
a.cc:27:3: error: expected ',' or ';' before 'int'
   27 |   int yakusuu1;
      |   ^~~
a.cc:30:11: error: no match for call to '(std::vector<int>) (int&)'
   30 |       if(A(j)%result1(i)==0){
      |          ~^~~
a.cc:30:22: error: no match for call to '(std::vector<int>) (int&)'
   30 |       if(A(j)%result1(i)==0){
      |               ~~~~~~~^~~
a.cc:35:7: error: 'yakusuu1' was not declared in this scope
   35 |       yakusuu1 = result1(i);
      |       ^~~~~~~~
a.cc:35:25: error: no match for call to '(std::vector<int>) (int&)'
   35 |       yakusuu1 = result1(i);
      |                  ~~~~~~~^~~
a.cc:41:3: error: expected ',' or ';' before 'int'
   41 |   int yakusuu2;
      |   ^~~
a.cc:44:11: error: no match for call to '(std::vector<int>) (int&)'
   44 |       if(A(j)%result2(i)==0){
      |          ~^~~
a.cc:44:22: error: no match for call to '(std::vector<int>) (int&)'
   44 |       if(A(j)%result2(i)==0){
      |               ~~~~~~~^~~
a.cc:49:7: error: 'yakusuu2' was not declared in this scope
   49 |       yakusuu2 = result2(i);
      |       ^~~~~~~~
a.cc:49:25: error: no match for call to '(std::vector<int>) (int&)'
   49 |       yakusuu2 = result2(i);
      |                  ~~~~~~~^~~