blob: 288e0110977cc19cdcdea827d41eca574347b655 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#include <cctype>
#include <iostream>
#include <string>
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
int T;
std::cin >> T;
for (int i = 0; i < T; i++) {
int _a, _b;
std::cin >> _a >> _b;
std::string a, b;
std::cin >> a >> b;
for (char &c : a) {
c = std::tolower(c);
}
for (char &c : b) {
c = std::tolower(c);
}
int count = 0;
for (int i = 0; i < b.size() - a.size() + 1; i++) {
if (a == b.substr(i, a.size())) {
count++;
}
}
std::cout << count << "\n";
}
return 0;
}
|