입력:
ljes=njak
출력:
6
백준 2941번 "크로아티아 알파벳" 문제의 코드입니다.
#include <bits/stdc++.h>
using namespace std;
int main(){
string input,token[8]={"c=","c-","dz=","d-","lj","nj","s=","z="};
cin>>input;
for(int i=0;i<8;i++)
for(int pos=input.find(token[i]);pos!=string::npos;pos=input.find(token[i]))
input.replace(pos,token[i].length(),"#");
cout<<input.length();
return 0;
}
위의 코드를 예제의 입력을 넣어 실행했을 때의 결과입니다.
백준 2475 검증수 C++ (0) | 2023.04.05 |
---|---|
백준 1157 단어 공부 C++ (0) | 2023.04.05 |
백준 4375 1 C++ (0) | 2023.04.04 |
백준 1629 곱셈 C++ (0) | 2023.04.04 |
백준 3986 좋은 단어 C++ (0) | 2023.04.04 |