```cpp #include <iostream> #include <string> #include <vector> int main() { int n; std::cin >> n; std::vector<std::string> students(n); for (int i = 0; i < n; ++i) { std::cin >> students[i]; } int m; std::cin >> m; for (int i = 0; i < m; ++i) { std::string query; std::cin >> query; bool found = false; for (int j = 0; j < n; ++j) { if (students[j] == query) { std::cout << j + 1 << std::endl; found = true; break; } } if (!found) { std::cout << "na" << std::endl; } } return 0; } ``` [2024-10-18 23:45:25 | AI写代码神器 | 242点数解答]