Files
python/LuoGu/RuMen/P1597.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

20 lines
723 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false); //读入输出优化的强迫症
map<char, int> _map;//表示以char类型为下标存储的是int
string st;
cin >> st;//输入
int len = st.length();
_map['a'] = _map['b'] = _map['c'] = '0';//注意初始化。。。。被坑了
for (int i = 0; i < len; i += 5)
if (st[i + 3] >= '0' && st[i + 3] <= '9')//注意判断是不是0~9
_map[st[i]] = st[i + 3];//直接取出数字赋值给对应变量
else _map[st[i]] = _map[st[i + 3]];//变量之间相赋值
printf("%c %c %c", _map['a'], _map['b'], _map['c']);
//输出三个变量
return 0;
}