Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
110068 | 邹昊辰 | 统计特定单词数 | C++ | Compile Error | 0 MS | 0 KB | 572 | 2025-02-14 12:11:51 |
#include<bits/stdc++.h> using namespace std; int main(){ string a,s; int q; cin>>s; getline(cin,a); int len=a.length(); int len2=s.length(); for(int i=0;i<len;i++){ if(a[i]>='A'&&a[i]<='A'){ a[i]==a[i]-32; } for(int i=0;i<len;i++){ if(s[i]>='A'&&s[i]<='A'){ s[i]==s[i]+32; } int sum=0; int wz=-1; int k=0; int t; for(int j=0;j<len2;j++){ if(s[j]==a[k]){ if(k==0){ t=i; } k++; } if(k==len&&s[i+1]==' '||i==len2-1){ sum++; if(wz==-1){ wz=t; }else{ t=0; } } } return 0; }
Main.cc: In function 'int main()': Main.cc:14:7: warning: value computed is not used [-Wunused-value] a[i]==a[i]-32; ^ Main.cc:18:7: warning: value computed is not used [-Wunused-value] s[i]==s[i]+32; ^ Main.cc:31:11: warning: suggest parentheses around '&&' within '||' [-Wparentheses] if(k==len&&s[i+1]==' '||i==len2-1){ ^ Main.cc:42:1: error: expected '}' at end of input } ^ Main.cc:7:6: warning: unused variable 'q' [-Wunused-variable] int q; ^ Main.cc:42:1: error: expected '}' at end of input } ^