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