Problem p02409 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
#include <string>

int main() {
  int count;
  int b, f, r, v;
  int temp;
  int room[4][3][10];

  for (int i = 0; i < 4; i++) {
    for (int l = 0; l < 3; l++) {
      for (int o = 0; o < 10; o++) {
        room[i][l][o] = 0;
      }
    }
  }

  // 箇数を入力
  scanf("%d\\n", &count);

  for (int i = 0; i < count; i++) {
    scanf("%d %d %d %d\\n", &b, &f, &r, &v);
    room[b - 1][f - 1][r - 1] = room[b - 1][f - 1][r - 1] + v;
  }

  // result
  int tno = 0;
  for (int i = 0; i < 3; i++) {
    printf(" %d %d %d %d %d %d %d %d %d %d\\n", room[tno][i][0], room[tno][i][1],
           room[tno][i][2], room[tno][i][3], room[tno][i][4], room[tno][i][5],
           room[tno][i][6], room[tno][i][7], room[tno][i][8], room[tno][i][9]);
  }
  printf("####################\\n");
  tno = 1;
  for (int i = 0; i < 3; i++) {
    printf(" %d %d %d %d %d %d %d %d %d %d\\n", room[tno][i][0], room[tno][i][1],
           room[tno][i][2], room[tno][i][3], room[tno][i][4], room[tno][i][5],
           room[tno][i][6], room[tno][i][7], room[tno][i][8], room[tno][i][9]);
  }
  printf("####################\\n");
  tno = 2;
  for (int i = 0; i < 3; i++) {
    printf(" %d %d %d %d %d %d %d %d %d %d\\n", room[tno][i][0], room[tno][i][1],
           room[tno][i][2], room[tno][i][3], room[tno][i][4], room[tno][i][5],
           room[tno][i][6], room[tno][i][7], room[tno][i][8], room[tno][i][9]);
  }
  printf("####################\\n");
  tno = 3;
  for (int i = 0; i < 3; i++) {
    printf(" %d %d %d %d %d %d %d %d %d %d\\n", room[tno][i][0], room[tno][i][1],
           room[tno][i][2], room[tno][i][3], room[tno][i][4], room[tno][i][5],
           room[tno][i][6], room[tno][i][7], room[tno][i][8], room[tno][i][9]);
  }

  return 0;
}


Error: -11

Fixed submission:

#include <stdio.h>
#include <string>

int main() {

  int count;
  int b, f, r, v;
  int temp;
  int room[4][3][10];

  for (int i = 0; i < 4; i++) {
    for (int l = 0; l < 3; l++) {
      for (int o = 0; o < 10; o++) {
        room[i][l][o] = 0;
      }
    }
  }

  // 箇数を入力
  scanf("%d\\n", &count);

  for (int i = 0; i < count; i++) {
    scanf("%d %d %d %d\\n", b, f, r, v);
    room[b - 1][f - 1][r - 1] + v;
  }

  // result
  int tno = 0;
  for (int i = 0; i < 3; i++) {
    printf("%d %d %d %d %d %d %d %d %d %d\\n", room[tno][i][0], room[tno][i][1],
           room[tno][i][2], room[tno][i][3], room[tno][i][4], room[tno][i][5],
           room[tno][i][6], room[tno][i][7], room[tno][i][8], room[tno][i][9]);
  }
  printf("####################");
  tno = 1;
  for (int i = 0; i < 3; i++) {
    printf("%d %d %d %d %d %d %d %d %d %d\\n", room[tno][i][0], room[tno][i][1],
           room[tno][i][2], room[tno][i][3], room[tno][i][4], room[tno][i][5],
           room[tno][i][6], room[tno][i][7], room[tno][i][8], room[tno][i][9]);
  }
  printf("####################");
  tno = 2;
  for (int i = 0; i < 3; i++) {
    printf("%d %d %d %d %d %d %d %d %d %d\\n", room[tno][i][0], room[tno][i][1],
           room[tno][i][2], room[tno][i][3], room[tno][i][4], room[tno][i][5],
           room[tno][i][6], room[tno][i][7], room[tno][i][8], room[tno][i][9]);
  }
  printf("####################");
  tno = 3;
  for (int i = 0; i < 3; i++) {
    printf("%d %d %d %d %d %d %d %d %d %d\\n", room[tno][i][0], room[tno][i][1],
           room[tno][i][2], room[tno][i][3], room[tno][i][4], room[tno][i][5],
           room[tno][i][6], room[tno][i][7], room[tno][i][8], room[tno][i][9]);
  }

  return 0;
}