Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
135900 田祥江 字符串包含判断 C++ Compile Error 0 MS 0 KB 359 2025-11-08 17:12:43

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ string s1,s2; cin>>s1>>s2; int len1=s1.size(); int len2=s2.size(); for(int i=0;i<len1;i++){ if(s1[i]==s2[0]){ for(int j=1;j<len2;j++){ if(si[i+j]!=s2[j]){ break; } } if(j==len2-1){ cout<<"yes"; return 0; } } } cout<<"no"; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:11:8: error: 'si' was not declared in this scope
     if(si[i+j]!=s2[j]){
        ^
Main.cc:15:7: error: 'j' was not declared in this scope
    if(j==len2-1){
       ^