'commit'
This commit is contained in:
19
LuoGu/RuMen/P1597.cpp
Normal file
19
LuoGu/RuMen/P1597.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user