Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
128026 黄戈 神族文字 C++ 通过 100 663 MS 16640 KB 613 2024-01-25 11:28:44

Tests(10/10):


#include <bits/stdc++.h> using namespace std; map <string,string> Map; int main(){ int card = 1; string str; while(1){ getline(cin,str); if(str==""){ break; } string card1,card2; int cnt = 0; for(int i = 0;i < str.size();i++){ if(str[i] == ' '){ cnt = i; break; } } for(int i = 0;i < cnt;i++){ card1 += str[i]; } for(int i = cnt + 1;i < str.size();i++){ card2 += str[i]; } Map[card2] = card1; } string s; while(cin>>s){ if(Map[s] == ""){ cout << "eh" << endl; } else{ cout << Map[s] << endl; } } }


测评信息: