답안 #104703

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
104703 2019-04-09T01:12:11 Z TAMREF 컴퓨터 네트워크 (BOI14_network) C++11
컴파일 오류
0 ms 0 KB
#include "network.h"
int dist[1005];
void findRoute (int n, int a, int b){
    for(int i = 1; i <= n; i++){
      if(i == b) continue;
      dist[i] = ping(i, b);
    }
    for(int now = a; now != b;){
      for(int k = 1; k <= n; k++){
        if(dist[k] + 1 == dist[now] && ping(k, now) == 1){
          travelTo(k);
          now = k
          break;
        }
      }
    }
    return;
}

Compilation message

network.cpp: In function 'void findRoute(int, int, int)':
network.cpp:13:11: error: expected ';' before 'break'
           break;
           ^~~~~
grader.c: In function 'int main()':
grader.c:48:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf ("%d%d%d%d", &N, &a, &b, &M);
     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
grader.c:51:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d", &distance[u][v]);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~