aboutsummaryrefslogtreecommitdiff
path: root/works/life/chuanzhi-cup/final-contest/3.cpp
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-02-12 15:55:21 +0800
committerYuqian Yang <crupest@crupest.life>2025-02-12 15:55:21 +0800
commit10eb95869601e145b1d8bc909424777c25752d51 (patch)
tree49449a4076ded9bd937a51679318edbe2a532cae /works/life/chuanzhi-cup/final-contest/3.cpp
parent29ba3e88b1a7425fe00af0005b8a8228103aa21c (diff)
parentf8c10dd1fc55e60f35286475356e48c4f642eb63 (diff)
downloadcrupest-10eb95869601e145b1d8bc909424777c25752d51.tar.gz
crupest-10eb95869601e145b1d8bc909424777c25752d51.tar.bz2
crupest-10eb95869601e145b1d8bc909424777c25752d51.zip
import(life): IMPORT crupest/life COMPLETE.
Diffstat (limited to 'works/life/chuanzhi-cup/final-contest/3.cpp')
-rw-r--r--works/life/chuanzhi-cup/final-contest/3.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/works/life/chuanzhi-cup/final-contest/3.cpp b/works/life/chuanzhi-cup/final-contest/3.cpp
new file mode 100644
index 0000000..288e011
--- /dev/null
+++ b/works/life/chuanzhi-cup/final-contest/3.cpp
@@ -0,0 +1,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;
+}