| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 69625 | 彭林江 | 统计特定单词数 | C++ | Wrong Answer | 1 MS | 280 KB | 541 | 2024-04-06 10:26:47 |
#include<bits/stdc++.h> using namespace std; int main(){ string z, m; //cin >> z; getline(cin, z); getline(cin, m); for(int i = 0; i < z.size(); i++){ if(z[i] >= 'A' && z[i] <= 'Z'){ z[i] +=32; } } for(int i = 0; i < m.size(); i++){ if(m[i] >= 'A' && m[i] <= 'Z'){ m[i] +=32; } } int first = m.find(z); int cnt = 0; int idx = m.find(z); while(idx >= 0){ cnt++; m[idx] = '*'; idx = m.find(z); //cout << "_______" << idx <<endl; } cout << cnt << " " << first; return 0; }
------Input------
alun Alunis the best teacher of TCJY alun
------Answer-----
1 32
------Your output-----
2 0