题解 | #红鲤鱼与绿鲤鱼与驴#
红鲤鱼与绿鲤鱼与驴
https://ac.nowcoder.com/acm/problem/54287
直接模拟即可。
输出是注意lv
中是v
不是u
。
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = 0; i < s.size(); i ++) {
if (s[i] == '1')
cout << "hongliyu";
if (s[i] == '2')
cout << "lvliyu";
if (s[i] == '3')
cout << "lv";
}
return 0;
}
已写的题解集 文章被收录于专栏
将自己知道的一些竞赛知识推广给大家