Submission #445156

#TimeUsernameProblemLanguageResultExecution timeMemory
445156AnYandEveryTracks in the Snow (BOI13_tracks)C++17
Compilation error
0 ms0 KiB
#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 (stderr)

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++){
      |             ^