문제
https://www.acmicpc.net/problem/30045
풀이
string의 find 함수를 통해 풀 수 있다.
코드
#include <iostream>
#include <string>
using namespace std;
int main() {
int n, res=0;
string str;
cin>>n;
for(int i=0;i<n;i++){
cin>>str;
if(str.find("01")!=string::npos || str.find("OI")!=string::npos)
res++;
}
cout<<res;
return 0;
}
'PS > Baekjoon' 카테고리의 다른 글
| [백준] 28648: Торговый центр(Kotlin) (0) | 2025.10.02 |
|---|---|
| [백준] 20336: Haughty Cuisine(C++) (0) | 2025.09.23 |
| [백준] 30676: 이 별은 무슨 색일까(C++) (1) | 2025.08.09 |
| [백준] 11319: Count Me In(C++) (0) | 2025.06.24 |
| [백준] 10874: 이교수님의 시험(C++) (0) | 2025.05.14 |
댓글