Language: C++

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

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


int main(void){
	while(1){
		//init
		int rosen,eki,a,b,incost,intime;
		for(int i=0; i<100; i++){ 
			for(int j=0; j<100; j++)
				time[i][j] = cost[i][j] = INF;
		}
		for(int i=0; i<100; 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:5:18: error: 'int time [100][100]' redeclared as different kind of entity
    5 | int time[100][100];
      |                  ^
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[i][j] = cost[i][j] = INF;
      |                                       ^
a.cc:16:42: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   16 |                                 time[i][j] = cost[i][j] = INF;
      |                                          ^
a.cc:16:44: error: assignment of read-only location '*(time + (((sizetype)i) + ((sizetype)j)))'
   16 |                                 time[i][j] = cost[i][j] = INF;
      |                                 ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
a.cc:19:31: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   19 |                         time[i][i] = cost[i][i] = 0;
      |                               ^
a.cc:19:34: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   19 |                         time[i][i] = cost[i][i] = 0;
      |                                  ^
a.cc:19:36: error: assignment of read-only location '*(time + (((sizetype)i) * 2))'
   19 |                         time[i][i] = cost[i][i] = 0;
      |                         ~~~~~~~~~~~^~~~~~~~~~~~~~~~
a.cc:28:31: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   28 |                         time[a][b] = time[b][a] = intime;
      |                               ^
a.cc:28:34: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   28 |                         time[a][b] = time[b][a] = intime;
      |                                  ^
a.cc:28:44: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   28 |                         time[a][b] = time[b][a] = intime;
      |                                            ^
a.cc:28:47: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   28 |                         time[a][b] = time[b][a] = intime;
      |                                               ^
a.cc:28:49: error: assignment of read-only location '*(time + (((sizetype)b) + ((sizetype)a)))'
   28 |                         time[a][b] = time[b][a] = intime;
      |                                      ~~~~~~~~~~~^~~~~~~~
a.cc:35:47: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   35 |                                         time[i][j] = min(time[i][j],time[i][k]+time[k][j]);
      |                                               ^
a.cc:35:50: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   35 |                                         time[i][j] = min(time[i][j],time[i][k]+time[k][j]);
      |                                                  ^
a.cc:35:64: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   35 |                                         time[i][j] = min(time[i][j],time[i][k]+time[k][j]);
      |                                                                ^
a.cc:35:67: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   35 |                                         time[i][j] = min(time[i][j],time[i][k]+time[k][j]);
      |                                                                   ^
a.cc:35:75: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   35 |                                         time[i][j] = min(time[i][j],time[i][k]+time[k][j]);
      |                                                                           ^
a.cc:35:78: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   35 |                                         time[i][j] = min(time[i][j],time[i][k]+time[k][j]);
      |                                                                              ^
a.cc:35:86: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   35 |                                         time[i][j] = min(time[i][j],time[i][k]+time[k][j]);
      |                                                                                      ^
a.cc:35:89: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   35 |                                         time[i][j] = min(time[i][j],time[i][k]+time[k][j]);
      |                                                                                         ^
a.cc:35: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+'
   35 |                                         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:51:47: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   51 |                                 cout << time[a][b] << endl;
      |                                               ^
a.cc:51:50: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   51 |                                 cout << time[a][b] << endl;
      |                                                  ^