Submission #445156

# Submission time Handle Problem Language Result Execution time Memory
445156 2021-07-16T16:38:54 Z AnYandEvery Tracks in the Snow (BOI13_tracks) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
int main(){
  int H, W; cin >> H >> W;
  bool rabbit = false, fox = false;
  for(int r = 0; r < H; r++){
    for(int c = 0; c < W; c++){
      char c; cin >> c;
      if(c=='R')rabbit = true;
      if(c=='F')fox = true;
    }
  }
  int ret = 0;
  if(rabbit)ret++;
  if(fox)ret++;
  cout << ret << endl;
}

Compilation message

tracks.cpp: In function 'int main()':
tracks.cpp:8:12: error: redeclaration of 'char c'
    8 |       char c; cin >> c;
      |            ^
tracks.cpp:7:13: note: 'int c' previously declared here
    7 |     for(int c = 0; c < W; c++){
      |             ^