8000 Update 2941.cpp · jm-Back/basic-algo-lecture@7237a4b · GitHub
[go: up one dir, main page]

Skip to content

Commit 7237a4b

Browse files
Update 2941.cpp
1 parent b00300f commit 7237a4b

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

Appendix A/solutions/2941.cpp

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
// Authored by : BaaaaaaaaaaarkingDog
22
// Co-authored by : -
3-
// http://boj.kr/****************
3+
// http://boj.kr/5295ed05414b482692b3eb2e0a9c2a42
44
#include <bits/stdc++.h>
55
using namespace std;
66

7-
int main(void){
7+
vector<string> alphas = {"c=", "c-", "dz=", "d-", "lj", "nj", "s=", "z="};
8+
9+
int main(void) {
810
ios::sync_with_stdio(0);
911
cin.tie(0);
10-
11-
}
12+
string w;
13+
cin >> w;
14+
for(auto alpha : alphas){
15+
while(true){
16+
int pos = w.find(alpha);
17+
if(pos == string::npos) break;
18+
w.replace(pos, alpha.size(), "1");
19+
}
20+
}
21+
cout << w.size();
22+
}

0 commit comments

Comments
 (0)
0