Language: C++

#include <iostream>
#include <cstring>

using namespace std;

const int INF=100000;
int cost[101][101];
int time[101][101];

int main(void){
	int n,m,a,b,c;
	while(1){
		for(a=0;a<=100;a++){
			for(b=0;b<=100;b++){
				cost[a][b]=INF;
				time[a][b]=INF;
				if(a==b)cost[a][b]=0,time[a][b]=0;
			}
		}
		cin >> n >> m;
		if(n==0 && m==0)break;
		for(a=0;a<n;a++){
			int f,t,co,ti;
			scanf("%d%d%d%d",&f,&t,&co,&ti);
			if(cost[f][t]>co)cost[f][t]=co,cost[t][f]=co;
			if(time[f][t]>ti)time[f][t]=ti,time[t][f]=ti;
		}
		for(a=1;a<=m;a++){
			for(b=1;b<=m;b++){
				for(c=1;c<=m;c++){
					cost[a][b]=min(cost[a][b],cost[a][c]+cost[c][b]);
					time[a][b]=min(time[a][b],time[a][c]+time[c][b]);
				}
			}
		}
		cin >> n;
		for(a=0;a<n;a++){
			int d,f,t;
			scanf("%d%d%d",&f,&t,&d);
			if(d==0)printf("%d\n",cost[f][t]);
			if(d==1)printf("%d\n",time[f][t]);
		}
	}
    return 0;
}

Compiler output:
a.cc:8:18: error: 'int time [101][101]' redeclared as different kind of entity
    8 | int time[101][101];
      |                  ^
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
   76 | extern time_t time (time_t *__timer) __THROW;
      |               ^~~~
a.cc: In function 'int main()':
a.cc:16:39: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   16 |                                 time[a][b]=INF;
      |                                       ^
a.cc:16:42: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   16 |                                 time[a][b]=INF;
      |                                          ^
a.cc:16:43: error: assignment of read-only location '*(time + (((sizetype)a) + ((sizetype)b)))'
   16 |                                 time[a][b]=INF;
      |                                 ~~~~~~~~~~^~~~
a.cc:17:60: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   17 |                                 if(a==b)cost[a][b]=0,time[a][b]=0;
      |                                                            ^
a.cc:17:63: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   17 |                                 if(a==b)cost[a][b]=0,time[a][b]=0;
      |                                                               ^
a.cc:17:64: error: assignment of read-only location '*(time + (((sizetype)a) + ((sizetype)b)))'
   17 |                                 if(a==b)cost[a][b]=0,time[a][b]=0;
      |                                                      ~~~~~~~~~~^~
a.cc:26:34: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   26 |                         if(time[f][t]>ti)time[f][t]=ti,time[t][f]=ti;
      |                                  ^
a.cc:26:37: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   26 |                         if(time[f][t]>ti)time[f][t]=ti,time[t][f]=ti;
      |                                     ^
a.cc:26:38: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   26 |                         if(time[f][t]>ti)time[f][t]=ti,time[t][f]=ti;
      |                            ~~~~~~~~~~^~~
a.cc:26:48: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   26 |                         if(time[f][t]>ti)time[f][t]=ti,time[t][f]=ti;
      |                                                ^
a.cc:26:51: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   26 |                         if(time[f][t]>ti)time[f][t]=ti,time[t][f]=ti;
      |                                                   ^
a.cc:26:52: error: assignment of read-only location '*(time + (((sizetype)f) + ((sizetype)t)))'
   26 |                         if(time[f][t]>ti)time[f][t]=ti,time[t][f]=ti;
      |                                          ~~~~~~~~~~^~~
a.cc:26:62: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   26 |                         if(time[f][t]>ti)time[f][t]=ti,time[t][f]=ti;
      |                                                              ^
a.cc:26:65: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   26 |                         if(time[f][t]>ti)time[f][t]=ti,time[t][f]=ti;
      |                                                                 ^
a.cc:26:66: error: assignment of read-only location '*(time + (((sizetype)t) + ((sizetype)f)))'
   26 |                         if(time[f][t]>ti)time[f][t]=ti,time[t][f]=ti;
      |                                                        ~~~~~~~~~~^~~
a.cc:32:47: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   32 |                                         time[a][b]=min(time[a][b],time[a][c]+time[c][b]);
      |                                               ^
a.cc:32:50: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   32 |                                         time[a][b]=min(time[a][b],time[a][c]+time[c][b]);
      |                                                  ^
a.cc:32:62: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   32 |                                         time[a][b]=min(time[a][b],time[a][c]+time[c][b]);
      |                                                              ^
a.cc:32:65: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   32 |                                         time[a][b]=min(time[a][b],time[a][c]+time[c][b]);
      |                                                                 ^
a.cc:32:73: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   32 |                                         time[a][b]=min(time[a][b],time[a][c]+time[c][b]);
      |                                                                         ^
a.cc:32:76: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   32 |                                         time[a][b]=min(time[a][b],time[a][c]+time[c][b]);
      |                                                                            ^
a.cc:32:84: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   32 |                                         time[a][b]=min(time[a][b],time[a][c]+time[c][b]);
      |                                                                                    ^
a.cc:32:87: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   32 |                                         time[a][b]=min(time[a][b],time[a][c]+time[c][b]);
      |                                                                                       ^
a.cc:32:77: error: invalid operands of types 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'} and 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'} to binary 'operator+'
   32 |                                         time[a][b]=min(time[a][b],time[a][c]+time[c][b]);
      |                                                                   ~~~~~~~~~~^~~~~~~~~~~
      |                                                                            |          |
      |                                                                            |          time_t(time_t*) noexcept {aka long int(long int*) noexcept}
      |                                                                            time_t(time_t*) noexcept {aka long int(long int*) noexcept}
a.cc:41:53: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   41 |                         if(d==1)printf("%d\n",time[f][t]);
      |                                                     ^
a.cc:41:56: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   41 |                         if(d==1)printf("%d\n",time[f][t]);
      |                                                        ^