Language: C++

#include<iostream>
#include<algorithm>
const int INF = 10000000;
const int N = 101;
int cost[N][N];
int time[N][N];
using namespace std;
int main()
{
	int n, m, a, b, co, ti,r;
	while (1){
		cin >> n >> m;
		if (n == 0 && m == 0)break;
		for (int i = 0; i < n; i++){
			for (int i2 = 0; i2 < n; i2++){
				cost[i][i2] = INF;
				time[i][i2] = INF;
			}
		}
		for (int i = 0; i < n; i++){
			cin >> a >> b >> co >> ti;
			cost[a][b] = co;
			cost[b][a] = co;
			time[a][b] = ti;
			time[b][a] = ti;
		}
		for (int k = 0; k < n; ++k)
			for (int i = 0; i < n; ++i)
				for (int j = 0; j < n; ++j)
				{
					cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j]);
					time[i][j] = min(time[i][j], time[i][k] + time[k][j]);
				}
		cin >> m;
		for (int i = 0; i < m; i++){
			cin >> a >> b >> r;
			if (r == 0){
				cout << cost[a][b] << endl;
			}
			else
				cout << time[a][b] << endl;
		}
	}
}

Compiler output:
a.cc:6:14: error: 'int time [101][101]' redeclared as different kind of entity
    6 | int time[N][N];
      |              ^
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][i2] = INF;
      |                                       ^
a.cc:17:43: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   17 |                                 time[i][i2] = INF;
      |                                           ^
a.cc:17:45: error: assignment of read-only location '*(time + (((sizetype)i) + ((sizetype)i2)))'
   17 |                                 time[i][i2] = INF;
      |                                 ~~~~~~~~~~~~^~~~~
a.cc:24:31: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   24 |                         time[a][b] = ti;
      |                               ^
a.cc:24:34: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   24 |                         time[a][b] = ti;
      |                                  ^
a.cc:24:36: error: assignment of read-only location '*(time + (((sizetype)a) + ((sizetype)b)))'
   24 |                         time[a][b] = ti;
      |                         ~~~~~~~~~~~^~~~
a.cc:25:31: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   25 |                         time[b][a] = ti;
      |                               ^
a.cc:25:34: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   25 |                         time[b][a] = ti;
      |                                  ^
a.cc:25:36: error: assignment of read-only location '*(time + (((sizetype)b) + ((sizetype)a)))'
   25 |                         time[b][a] = ti;
      |                         ~~~~~~~~~~~^~~~
a.cc:32:47: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   32 |                                         time[i][j] = min(time[i][j], time[i][k] + time[k][j]);
      |                                               ^
a.cc:32:50: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   32 |                                         time[i][j] = min(time[i][j], time[i][k] + time[k][j]);
      |                                                  ^
a.cc:32:64: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   32 |                                         time[i][j] = min(time[i][j], time[i][k] + time[k][j]);
      |                                                                ^
a.cc:32:67: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   32 |                                         time[i][j] = min(time[i][j], time[i][k] + time[k][j]);
      |                                                                   ^
a.cc:32:76: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   32 |                                         time[i][j] = min(time[i][j], time[i][k] + time[k][j]);
      |                                                                            ^
a.cc:32:79: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   32 |                                         time[i][j] = min(time[i][j], time[i][k] + time[k][j]);
      |                                                                               ^
a.cc:32:89: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   32 |                                         time[i][j] = min(time[i][j], time[i][k] + time[k][j]);
      |                                                                                         ^
a.cc:32:92: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   32 |                                         time[i][j] = min(time[i][j], time[i][k] + time[k][j]);
      |                                                                                            ^
a.cc:32:81: 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[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:41:47: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   41 |                                 cout << time[a][b] << endl;
      |                                               ^
a.cc:41:50: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   41 |                                 cout << time[a][b] << endl;
      |                                                  ^