Language: C++

#include<iostream>
#include<algorithm>
using namespace std;

const int LEN = 100;
const int INF = 10000;
int time[LEN][LEN];
int cost[LEN][LEN];


int main(void){
	while(1){
		//init
		int rosen,eki,a,b,incost,intime;
		for(int i=0; i<LEN; i++){ 
			for(int j=0; j<LEN; j++)
				time[i][j] = cost[i][j] = INF;
		}
		for(int i=0; i<LEN; i++)
			time[i][i] = cost[i][i] = 0;
	
		//in
		cin >> rosen >> eki; 
		if(rosen==0&&eki==0)break;
		for(int i=0; i<rosen; i++){
			cin >> a >> b >> incost >> intime;
			a--; b--;
			cost[a][b] = cost[b][a] = incost;
			time[a][b] = time[b][a] = intime;
		}

		//calc
		for(int k=0; k<eki; k++){
			for(int i=0; i<eki; i++){
				for(int j=0; j<eki; j++){
					time[i][j] = min(time[i][j],time[i][k]+time[k][j]);
					cost[i][j] = min(cost[i][j],cost[i][k]+cost[k][j]);
				}
			}
		}

		//out
		int toi;
		cin >> toi;
		for(int i=0; i<toi; i++){
			int a,b,r;
			cin >> a >> b >> r;
			a--; b--;
			if(r==0)
				cout << cost[a][b] << endl;
			else
				cout << time[a][b] << endl;
		}
	}

	return 0;
}

Compiler output:
a.cc:7:18: error: 'int time [100][100]' redeclared as different kind of entity
    7 | int time[LEN][LEN];
      |                  ^
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:17:39: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   17 |                                 time[i][j] = cost[i][j] = INF;
      |                                       ^
a.cc:17:42: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   17 |                                 time[i][j] = cost[i][j] = INF;
      |                                          ^
a.cc:17:44: error: assignment of read-only location '*(time + (((sizetype)i) + ((sizetype)j)))'
   17 |                                 time[i][j] = cost[i][j] = INF;
      |                                 ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
a.cc:20:31: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   20 |                         time[i][i] = cost[i][i] = 0;
      |                               ^
a.cc:20:34: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   20 |                         time[i][i] = cost[i][i] = 0;
      |                                  ^
a.cc:20:36: error: assignment of read-only location '*(time + (((sizetype)i) * 2))'
   20 |                         time[i][i] = cost[i][i] = 0;
      |                         ~~~~~~~~~~~^~~~~~~~~~~~~~~~
a.cc:29:31: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   29 |                         time[a][b] = time[b][a] = intime;
      |                               ^
a.cc:29:34: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   29 |                         time[a][b] = time[b][a] = intime;
      |                                  ^
a.cc:29:44: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   29 |                         time[a][b] = time[b][a] = intime;
      |                                            ^
a.cc:29:47: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   29 |                         time[a][b] = time[b][a] = intime;
      |                                               ^
a.cc:29:49: error: assignment of read-only location '*(time + (((sizetype)b) + ((sizetype)a)))'
   29 |                         time[a][b] = time[b][a] = intime;
      |                                      ~~~~~~~~~~~^~~~~~~~
a.cc:36:47: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   36 |                                         time[i][j] = min(time[i][j],time[i][k]+time[k][j]);
      |                                               ^
a.cc:36:50: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   36 |                                         time[i][j] = min(time[i][j],time[i][k]+time[k][j]);
      |                                                  ^
a.cc:36:64: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   36 |                                         time[i][j] = min(time[i][j],time[i][k]+time[k][j]);
      |                                                                ^
a.cc:36:67: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   36 |                                         time[i][j] = min(time[i][j],time[i][k]+time[k][j]);
      |                                                                   ^
a.cc:36:75: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   36 |                                         time[i][j] = min(time[i][j],time[i][k]+time[k][j]);
      |                                                                           ^
a.cc:36:78: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   36 |                                         time[i][j] = min(time[i][j],time[i][k]+time[k][j]);
      |                                                                              ^
a.cc:36:86: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   36 |                                         time[i][j] = min(time[i][j],time[i][k]+time[k][j]);
      |                                                                                      ^
a.cc:36:89: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   36 |                                         time[i][j] = min(time[i][j],time[i][k]+time[k][j]);
      |                                                                                         ^
a.cc:36:79: 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+'
   36 |                                         time[i][j] = min(time[i][j],time[i][k]+time[k][j]);
      |                                                                     ~~~~~~~~~~^~~~~~~~~~~
      |                                                                              |          |
      |                                                                              |          time_t(time_t*) noexcept {aka long int(long int*) noexcept}
      |                                                                              time_t(time_t*) noexcept {aka long int(long int*) noexcept}
a.cc:52:47: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   52 |                                 cout << time[a][b] << endl;
      |                                               ^
a.cc:52:50: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   52 |                                 cout << time[a][b] << endl;
      |                                                  ^