Language: C++

#include<bits/stdc++.h>
using namespace std;
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int inf=1e9+7;
ll WF(ll *d[][],ll n){
    rep(i,n){
        rep(j,n){
            rep(k,n){
                d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
            }
        }
    }
}
int main{
    ll n,m,l;cin>>n>>m>>l;
    ll d[n][n];
    rep(i,n)rep(j,n)d[i][j]=inf;
    rep(i,m){
        ll a,b,c;cin>>a>>b>>c;
        a--;b--;
        d[a][b]=c;
        d[b][a]=c;
    }
    WF(d,n);
    ll dd[n][n];
    rep(i,n)rep(j,n){
        if(d[i][j]<=l)dd[i][j]=1;
        dd[i][j]=inf;
    }
    WF(dd,n);
    ll q;cin>>q;
    while(q){
        q--;
        ll s,t;cin>>s>>t;
        s--;t--;
        if(dd[s][t]>300)cout<<-1<<endl;
        else cout<<dd[i][j]-1<<endl;
    }
}

Compiler output:
a.cc:10:11: error: declaration of 'd' as multidimensional array must have bounds for all dimensions except the first
   10 | ll WF(ll *d[][],ll n){
      |           ^
a.cc:10:16: error: expected ')' before ',' token
   10 | ll WF(ll *d[][],ll n){
      |      ~         ^
      |                )
a.cc:10:20: error: expected initializer before 'n'
   10 | ll WF(ll *d[][],ll n){
      |                    ^
a.cc:19:5: error: cannot declare '::main' to be a global variable
   19 | int main{
      |     ^~~~
a.cc:20:8: error: expected primary-expression before 'n'
   20 |     ll n,m,l;cin>>n>>m>>l;
      |        ^
a.cc:20:8: error: expected '}' before 'n'
a.cc:19:9: note: to match this '{'
   19 | int main{
      |         ^
a.cc:20:14: error: 'cin' does not name a type
   20 |     ll n,m,l;cin>>n>>m>>l;
      |              ^~~
a.cc:21:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   21 |     ll d[n][n];
      |          ^
      |          yn
a.cc:21:13: error: 'n' was not declared in this scope; did you mean 'yn'?
   21 |     ll d[n][n];
      |             ^
      |             yn
a.cc:3:20: error: expected unqualified-id before 'for'
    3 | #define REP(i,m,n) for(int i=(m);i<(n);i++)
      |                    ^~~
a.cc:4:18: note: in expansion of macro 'REP'
    4 | #define rep(i,n) REP(i,0,n)
      |                  ^~~
a.cc:22:5: note: in expansion of macro 'rep'
   22 |     rep(i,n)rep(j,n)d[i][j]=inf;
      |     ^~~
a.cc:22:9: error: 'i' does not name a type
   22 |     rep(i,n)rep(j,n)d[i][j]=inf;
      |         ^
a.cc:3:34: note: in definition of macro 'REP'
    3 | #define REP(i,m,n) for(int i=(m);i<(n);i++)
      |                                  ^
a.cc:22:5: note: in expansion of macro 'rep'
   22 |     rep(i,n)rep(j,n)d[i][j]=inf;
      |     ^~~
a.cc:22:9: error: 'i' does not name a type
   22 |     rep(i,n)rep(j,n)d[i][j]=inf;
      |         ^
a.cc:3:40: note: in definition of macro 'REP'
    3 | #define REP(i,m,n) for(int i=(m);i<(n);i++)
      |                                        ^
a.cc:22:5: note: in expansion of macro 'rep'
   22 |     rep(i,n)rep(j,n)d[i][j]=inf;
      |     ^~~
a.cc:22:17: error: 'j' does not name a type
   22 |     rep(i,n)rep(j,n)d[i][j]=inf;
      |                 ^
a.cc:3:34: note: in definition of macro 'REP'
    3 | #define REP(i,m,n) for(int i=(m);i<(n);i++)
      |                                  ^
a.cc:22:13: note: in expansion of macro 'rep'
   22 |     rep(i,n)rep(j,n)d[i][j]=inf;
      |             ^~~
a.cc:22:17: error: 'j' does not name a type
   22 |     rep(i,n)rep(j,n)d[i][j]=inf;
      |                 ^
a.cc:3:40: note: in definition of macro 'REP'
    3 | #define REP(i,m,n) for(int i=(m);i<(n);i++)
      |                                        ^
a.cc:22:13: note: in expansion of macro 'rep'
   22 |     rep(i,n)rep(j,n)d[i][j]=inf;
      |             ^~~
a.cc:3:20: error: expected unqualified-id before 'for'
    3 | #define REP(i,m,n) for(int i=(m);i<(n);i++)
      |                    ^~~
a.cc:4:18: note: in expansion of macro 'REP'
    4 | #define rep(i,n) REP(i,0,n)
      |                  ^~~
a.cc:23:5: note: in expansion of macro 'rep'
   23 |     rep(i,m){
      |     ^~~
a.cc:23:9: error: 'i' does not name a type
   23 |     rep(i,m){
      |         ^
a.cc:3:34: note: in definition of macro 'REP'
    3 | #define REP(i,m,n) for(int i=(m);i<(n);i++)
      |                                  ^
a.cc:23:5: note: in expansion of macro 'rep'
   23 |     rep(i,m){
      |     ^~~
a.cc:23:9: error: 'i' does not name a type
   23 |     rep(i,m){
      |         ^
a.cc:3:40: note: in definition of macro 'REP'
    3 | #define REP(i,m,n) for(int i=(m);i<(n);i++)
      |                                        ^
a.cc:23:5: note: in expansion of macro 'rep'
   23 |     rep(i,m){
      |     ^~~
a.cc:29:7: error: expected constructor, destructor, or type conversion before '(' token
   29 |     WF(d,n);
      |       ^
a.cc:30:11: error: 'n' was not declared in this scope; did you mean 'yn'?
   30 |     ll dd[n][n];
      |           ^
      |           yn
a.cc:30:14: error: 'n' was not declared in this scope; did you mean 'yn'?
   30 |     ll dd[n][n];
      |              ^
      |              yn
a.cc:3:20: error: expected unqualified-id before 'for'
    3 | #define REP(i,m,n) for(int i=(m);i<(n);i++)
      |                    ^~~
a.cc:4:18: note: in expansion of macro 'REP'
    4 | #define rep(i,n) REP(i,0,n)
      |                  ^~~
a.cc:31:5: note: in expansion of macro 'rep'
   31 |     rep(i,n)rep(j,n){
      |     ^~~
a.cc:31:9: error: 'i' does not name a type
   31 |     rep(i,n)rep(j,n){
      |         ^
a.cc:3:34: note: in definition of macro 'REP'
    3 | #define REP(i,m,n) for(int i=(m);i<(n);i++)
      |                                  ^
a.cc:31:5: note: in expansion of macro 'rep'
   31 |     rep(i,n)rep(j,n){
      |     ^~~
a.cc:31:9: error: 'i' does not name a type
   31 |     rep(i,n)rep(j,n){
      |         ^
a.cc:3:40: note: in definition of macro 'REP'
    3 | #define REP(i,m,n) for(int i=(m);i<(n);i++)
      |                                        ^
a.cc:31:5: note: in expansion of macro 'rep'
   31 |     rep(i,n)rep(j,n){
      |     ^~~
a.cc:31:17: error: 'j' does not name a type
   31 |     rep(i,n)rep(j,n){
      |                 ^
a.cc:3:34: note: in definition of macro 'REP'
    3 | #define REP(i,m,n) for(int i=(m);i<(n);i++)
      |                                  ^
a.cc:31:13: note: in expansion of macro 'rep'
   31 |     rep(i,n)rep(j,n){
      |             ^~~
a.cc:31:17: error: 'j' does not name a type
   31 |     rep(i,n)rep(j,n){
      |                 ^
a.cc:3:40: note: in definition of macro 'REP'
    3 | #define REP(i,m,n) for(int i=(m);i<(n);i++)
      |                                        ^
a.cc:31:13: note: in expansion of macro 'rep'
   31 |     rep(i,n)rep(j,n){
      |             ^~~
a.cc:35:7: error: expected constructor, destructor, or type conversion before '(' token
   35 |     WF(dd,n);
      |       ^
a.cc:36:10: error: 'cin' does not name a type
   36 |     ll q;cin>>q;
      |          ^~~
a.cc:37:5: error: expected unqualified-id before 'while'
   37 |     while(q){
      |     ^~~~~
a.cc:44:1: error: expected declaration before '}' token
   44 | }
      | ^