| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 69580 | 殷震轩 | 统计特定单词数 | C++ | Compile Error | 0 MS | 0 KB | 592 | 2024-04-05 20:23:17 |
# include<cstring> # include<cstring> using namespace std; int main(){ string a,b; getline(cin,b); getline(cin,a); int l=a.size(),l2=b.size(),cnt=0,t=0,i,j,q=a.find(b); j=a.find(b); for (i=0;i<l;i++){ if (a[i]>='A' && a[i]<='Z') a[i]=a[i]+32; } for (i=0;i<l2;i++){ if (b[i]>='A' && b[i]<='Z') b[i]=b[i]+32; } if (q!=-1){ while (q!=-1){ a.erase(q,l2); q=a.find(b); cnt++; } cout<<cnt<<" "<<j; return 0; } cout<<q; return 0; }
Main.cc: In function 'int main()':
Main.cc:5:4: error: 'string' was not declared in this scope
string a,b;
^
Main.cc:6:12: error: 'cin' was not declared in this scope
getline(cin,b);
^
Main.cc:6:16: error: 'b' was not declared in this scope
getline(cin,b);
^
Main.cc:6:17: error: 'getline' was not declared in this scope
getline(cin,b);
^
Main.cc:7:16: error: 'a' was not declared in this scope
getline(cin,a);
^
Main.cc:9:4: error: 'j' was not declared in this scope
j=a.find(b);
^
Main.cc:10:9: error: 'i' was not declared in this scope
for (i=0;i