79084424

Date: 2024-10-14 00:24:45
Score: 0.5
Natty:
Report link

It looks like I just needed to include algorithm explicitly. I am not sure why this did not error when running g++11, but it is now working.

#include <iostream>
#include <algorithm>

using namespace std;
int main() {
  char shipLetters[] = { 'A', 'B', 'S', 'C', 'D' };
  char selection;
  cin >> selection;
  char *index = std::find(begin(shipLetters), end(shipLetters), selection);
  cout << index << endl;
  return 0;
}
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: slackwars