사생활 보호 설정
https://gamjia.tistory.com
Updated News
Mini Rooms
답글수 [0]
What Friends Say
한마디로 표현해봐~
1촌평 관리
2941번 크로아티아 알파벳
GamJia 2023. 3. 29. 20:01
단계별로 풀어보기 - 문자열 - 9단계
https://www.acmicpc.net/problem/2941
#include <iostream> #include <string> #include <vector> using namespace std; int main() { vector<string> Croatia={"c=","c-","dz=","d-","lj","nj","s=","z="}; string S; cin>>S; int index; for(int i=0;i<Croatia.size();i++) { while(1) { index=S.find(Croatia.at(i)); if(index==string::npos) // 찾는 문자열이 없으면 break { break; } S.replace(index,Croatia.at(i).length(),"#"); // 크로아티아 알파벳을 #로 바꿈 } } cout<<S.length(); return 0; }