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[][310],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[310][310];
    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[310][310];
    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: In function 'll WF(ll* (*)[310], ll)':
a.cc:14:44: error: invalid operands of types 'll*' {aka 'long long int*'} and 'll*' {aka 'long long int*'} to binary 'operator+'
   14 |                 d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
      |                                     ~~~~~~~^~~~~~~~
      |                                           |       |
      |                                           |       ll* {aka long long int*}
      |                                           ll* {aka long long int*}
a.cc:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
   18 | }
      | ^
a.cc: At global scope:
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: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: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 | }
      | ^