Language: C++

#include <bits/stdc++.h>
struct station {
  int num;
  int C;
  int S;
  int F;
}sta;
void check(int num);
int main(){
  int N;
  std::cin >> N;
  sta[N];
  for(int i = 1;i<=N;i++){
    if(i == N){sta[i].num = 0;break;}
    std::cin>>sta[i].C>>sta[i].S>>sta[i].F;
    sta[i].num = i;
  }
  for(int i = 1;i<=N;i++){
     check(i);
  }
  
 return 0; 
}

void check(int num){
  if(sta.[num] == 0){std::cout<<0<<'\n';return;}
  int all = 0;
  for(int i = num;num<N;i++){
   if(i == num){
     all+=(sta[i].C + sta[i].S);
   }else{
     if(all < sta[i].S)all+=sta[i].S-all+sta[i].C;
     while((all - sta[i].S)%sta[i].F==0){all++;}
     all+=sta[i].C;
   }
  }
  std::cout<<all<<'\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:6: error: no match for 'operator[]' (operand types are 'station' and 'int')
   12 |   sta[N];
      |      ^
a.cc:14:19: error: no match for 'operator[]' (operand types are 'station' and 'int')
   14 |     if(i == N){sta[i].num = 0;break;}
      |                   ^
a.cc:15:18: error: no match for 'operator[]' (operand types are 'station' and 'int')
   15 |     std::cin>>sta[i].C>>sta[i].S>>sta[i].F;
      |                  ^
a.cc:15:28: error: no match for 'operator[]' (operand types are 'station' and 'int')
   15 |     std::cin>>sta[i].C>>sta[i].S>>sta[i].F;
      |                            ^
a.cc:15:38: error: no match for 'operator[]' (operand types are 'station' and 'int')
   15 |     std::cin>>sta[i].C>>sta[i].S>>sta[i].F;
      |                                      ^
a.cc:16:8: error: no match for 'operator[]' (operand types are 'station' and 'int')
   16 |     sta[i].num = i;
      |        ^
a.cc: In function 'void check(int)':
a.cc:26:10: error: expected unqualified-id before '[' token
   26 |   if(sta.[num] == 0){std::cout<<0<<'\n';return;}
      |          ^
a.cc:28:23: error: 'N' was not declared in this scope
   28 |   for(int i = num;num<N;i++){
      |                       ^
a.cc:30:15: error: no match for 'operator[]' (operand types are 'station' and 'int')
   30 |      all+=(sta[i].C + sta[i].S);
      |               ^
a.cc:30:26: error: no match for 'operator[]' (operand types are 'station' and 'int')
   30 |      all+=(sta[i].C + sta[i].S);
      |                          ^
a.cc:32:18: error: no match for 'operator[]' (operand types are 'station' and 'int')
   32 |      if(all < sta[i].S)all+=sta[i].S-all+sta[i].C;
      |                  ^
a.cc:32:32: error: no match for 'operator[]' (operand types are 'station' and 'int')
   32 |      if(all < sta[i].S)all+=sta[i].S-all+sta[i].C;
      |                                ^
a.cc:32:45: error: no match for 'operator[]' (operand types are 'station' and 'int')
   32 |      if(all < sta[i].S)all+=sta[i].S-all+sta[i].C;
      |                                             ^
a.cc:33:22: error: no match for 'operator[]' (operand types are 'station' and 'int')
   33 |      while((all - sta[i].S)%sta[i].F==0){all++;}
      |                      ^
a.cc:33:32: error: no match for 'operator[]' (operand types are 'station' and 'int')
   33 |      while((all - sta[i].S)%sta[i].F==0){all++;}
      |                                ^
a.cc:34:14: error: no match for 'operator[]' (operand types are 'station' and 'int')
   34 |      all+=sta[i].C;
      |              ^