Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
3450 邓程允 字符串包含判断 C++ Compile Error 0 MS 0 KB 271 2024-06-08 16:52:24

Tests(0/0):


Code:

# include<iostream> using namespace std; int main(){ string a,b,c=''; cin>>a>>b; for(int i=0;i<a.size();i++){ for(int j=i;j<i+b.size();j++){ c+=a[j]; } } if(c==b)cout<<"Yes"; else cout<<"No" return 0; }


Run Info:

Main.cc:4:18: error: empty character constant
     string a,b,c='';
                  ^
Main.cc: In function 'int main()':
Main.cc:6:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<a.size();i++){
                          ^
Main.cc:7:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j=i;j<i+b.size();j++){
                                ^
Main.cc:13:5: error: expected ';' before 'return'
     return 0;
     ^