Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cmath>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define fi first
#define se second

void floyd (int n){//n??????????????°
	rep(k, n) rep(i, n) rep(j, n)
		dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);//???????????????????????¢?????\???
	
	//????????????
    printf("%d ", s);
    int now = s;//now????¬?????????????????????????
    while (now != g){
    	rep(i, n){//??¨????????????????¢??????????
    		if (now == i) continue;//??????????????§???????????????
    		//?????????????????????????????? distmemo[now][i] ???????????°??????
    		//???????????????????????¨???????????£???????????????????????£????±????????????????????????????????????????????????¨?????´?????????????¢????????????????
    		if (dist[now][g] == distmemo[now][i] + dist[i][g] && distmemo[now][i] > 0){
        		now = i;
        		if (now == g) printf("%d\n", g);
        		else printf("%d ", now);
        		break;
        	}
        }
    }
}


int main(void){
	int n, m;
	cin >> n >> m >> s >> g;
	//??§???????????°?????§?????????
	rep(i, n)rep(j, n) dist[i][j] = dist[j][i] = INF;
	//????????¨???0??§???????????????????????
	rep(i, n)rep(j, n) distmemo[i][j] = distmemo[j][i] = 0;

	//????????¨?????????0
	rep(i, n) dist[i][i] = 0;
	//??\???
	rep(i, m){
		int a, b, c;
		scanf("%d%d%d", &a,&b,&c);
		dist[a][b] = dist[b][a] = c;//?????????????????????????????§???2????????£??\???????????¨
		distmemo[a][b] = distmemo[b][a] = c;//??????????????????????????¢??¨
	}
	rep(i, )
	floyd(n);//???????????°
	return 0;		
}

Compiler output:
a.cc: In function 'void floyd(int)':
a.cc:16:17: error: 'dist' was not declared in this scope
   16 |                 dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);//???????????????????????¢?????\???
      |                 ^~~~
a.cc:19:19: error: 's' was not declared in this scope
   19 |     printf("%d ", s);
      |                   ^
a.cc:21:19: error: 'g' was not declared in this scope
   21 |     while (now != g){
      |                   ^
a.cc:26:21: error: 'dist' was not declared in this scope
   26 |                 if (dist[now][g] == distmemo[now][i] + dist[i][g] && distmemo[now][i] > 0){
      |                     ^~~~
a.cc:26:37: error: 'distmemo' was not declared in this scope
   26 |                 if (dist[now][g] == distmemo[now][i] + dist[i][g] && distmemo[now][i] > 0){
      |                                     ^~~~~~~~
a.cc: In function 'int main()':
a.cc:39:26: error: 's' was not declared in this scope
   39 |         cin >> n >> m >> s >> g;
      |                          ^
a.cc:39:31: error: 'g' was not declared in this scope
   39 |         cin >> n >> m >> s >> g;
      |                               ^
a.cc:41:28: error: 'dist' was not declared in this scope
   41 |         rep(i, n)rep(j, n) dist[i][j] = dist[j][i] = INF;
      |                            ^~~~
a.cc:41:54: error: 'INF' was not declared in this scope
   41 |         rep(i, n)rep(j, n) dist[i][j] = dist[j][i] = INF;
      |                                                      ^~~
a.cc:43:28: error: 'distmemo' was not declared in this scope
   43 |         rep(i, n)rep(j, n) distmemo[i][j] = distmemo[j][i] = 0;
      |                            ^~~~~~~~
a.cc:46:19: error: 'dist' was not declared in this scope
   46 |         rep(i, n) dist[i][i] = 0;
      |                   ^~~~
a.cc:51:17: error: 'dist' was not declared in this scope
   51 |                 dist[a][b] = dist[b][a] = c;//?????????????????????????????§???2????????£??\???????????¨
      |                 ^~~~
a.cc:52:17: error: 'distmemo' was not declared in this scope
   52 |                 distmemo[a][b] = distmemo[b][a] = c;//??????????????????????????¢??¨
      |                 ^~~~~~~~
a.cc:9:34: error: expected primary-expression before ')' token
    9 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                                  ^
a.cc:54:9: note: in expansion of macro 'rep'
   54 |         rep(i, )
      |         ^~~