8000 Update 1543.cpp · sinnee/basic-algo-lecture@b00300f · GitHub
[go: up one dir, main page]

Skip to content

Commit b00300f

Browse files
Update 1543.cpp
1 parent 56d226d commit b00300f

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

Appendix A/solutions/1543.cpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
1-
!
1+
// Authored by : BaaaaaaaaaaarkingDog
2+
// Co-authored by : -
3+
// http://boj.kr/80c18d63aed84be4af35b307433dc5db
4+
#include <bits/stdc++.h>
5+
using namespace std;
6+
7+
int main(void) {
8+
ios::sync_with_stdio(0);
9+
cin.tie(0);
10+
string t, p;
11+
getline(cin, t);
12+
getline(cin, p);
13+
int cnt = 0;
14+
int f = t.find(p);
15+
while(f != string::npos){
16+
cnt++;
17+
f = t.find(p, f + p.size());
18+
}
19+
cout << cnt;
20+
}

0 commit comments

Comments
 (0)
0