Language: C++

#include <iostream>                                                                                                                                                 
#include <math.h>                                                                                                                                                   
                                                                                                                                                                    
int main(void){                                                                                                                                                     
  int N;                                                                                                                                                            
  long int L;                                                                                                                                                       
  std::vector<int> T;                                                                                                                                               
  std::vector<double> angles;                                                                                                                                       
  std::vector<double> cos_, sin_, cos_2, sin_2;                                                                                                                     
  std::cin >> N;                                                                                                                                                    
  std::cin >> L;                                                                                                                                                    
  for(size_t i = 0 ; i<N; i++){                                                                                                                                     
    int tmp;                                                                                                                                                        
    std::cin >> tmp;                                                                                                                                                
    T.push_back(tmp);                                                                                                                                               
    angles.push_back(2 * tmp*M_PI / L);                                                                                                                             
    cos_.push_back(cos(angles[i]));                                                                                                                                 
    sin_.push_back(sin(angles[i]));                                                                                                                                 
    //cos_2.push_back(cos(0.5*angles[i]));                                                                                                                          
    sin_2.push_back(sin(0.5*angles[i]));                                                                                                                            
  }                                                                                                                                                                 
                                                                                                                                                                    
  double Ex = 0;                                                                                                                                                    
  double Ey = 0;                                                                                                                                                    
  int count =0;                                                                                                                                                     
  for(size_t i = 0; i < N -2; i++){                                                                                                                                 
    for(size_t j=i+1; j < N-1; j++){                                                                                                                                
      for(size_t k=j+1; k < N; k++){                                                                                                                                
        double a = abs(sin(0.5*(angles[i]-angles[j])));                                                                                                             
        double b = abs(sin(0.5*(angles[j]-angles[k])));                                                                                                             
        double c = abs(sin(0.5*(angles[k]-angles[i])));                                                                                                             
        double mother =a+b+c;                                                                                                                                       
        Ex += (b*cos_[i] + c*cos_[j] + a*cos_[k])/mother;                                                                                                           
        Ey += (b*sin_[i] + c*sin_[j] + a*sin_[k])/mother;                                                                                                           
        count++;                                                                                                                                                    
      }                                                                                                                                                             
    }                                                                                                                                                               
  }                                                                                                                                                                 
  std::cout << Ex/count << " " << Ey/count;                                                                                                                         
  return 0;                                                                                                                                                         
}     

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: 'vector' is not a member of 'std'
    7 |   std::vector<int> T;
      |        ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <math.h>
  +++ |+#include <vector>
    3 | 
a.cc:7:15: error: expected primary-expression before 'int'
    7 |   std::vector<int> T;
      |               ^~~
a.cc:8:8: error: 'vector' is not a member of 'std'
    8 |   std::vector<double> angles;
      |        ^~~~~~
a.cc:8:8: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:8:15: error: expected primary-expression before 'double'
    8 |   std::vector<double> angles;
      |               ^~~~~~
a.cc:9:8: error: 'vector' is not a member of 'std'
    9 |   std::vector<double> cos_, sin_, cos_2, sin_2;
      |        ^~~~~~
a.cc:9:8: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:9:15: error: expected primary-expression before 'double'
    9 |   std::vector<double> cos_, sin_, cos_2, sin_2;
      |               ^~~~~~
a.cc:15:5: error: 'T' was not declared in this scope
   15 |     T.push_back(tmp);
      |     ^
a.cc:16:5: error: 'angles' was not declared in this scope
   16 |     angles.push_back(2 * tmp*M_PI / L);
      |     ^~~~~~
a.cc:17:5: error: 'cos_' was not declared in this scope; did you mean 'cosl'?
   17 |     cos_.push_back(cos(angles[i]));
      |     ^~~~
      |     cosl
a.cc:18:5: error: 'sin_' was not declared in this scope; did you mean 'sinl'?
   18 |     sin_.push_back(sin(angles[i]));
      |     ^~~~
      |     sinl
a.cc:20:5: error: 'sin_2' was not declared in this scope
   20 |     sin_2.push_back(sin(0.5*angles[i]));
      |     ^~~~~
a.cc:29:33: error: 'angles' was not declared in this scope
   29 |         double a = abs(sin(0.5*(angles[i]-angles[j])));
      |                                 ^~~~~~
a.cc:33:18: error: 'cos_' was not declared in this scope; did you mean 'cosl'?
   33 |         Ex += (b*cos_[i] + c*cos_[j] + a*cos_[k])/mother;
      |                  ^~~~
      |                  cosl
a.cc:34:18: error: 'sin_' was not declared in this scope; did you mean 'sinl'?
   34 |         Ey += (b*sin_[i] + c*sin_[j] + a*sin_[k])/mother;
      |                  ^~~~
      |                  sinl