Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
119671 毛靖平 字符串包含判断 C++ Compile Error 0 MS 0 KB 406 2025-05-18 13:33:11

Tests(0/0):


Code:

#include<iostream> #include<cstdio> #include<cstring> #include<cmath> string s1,s2; using namespace std; int main(){ int t=-1; cin>>s1>>s2; t=s1.find(s2); //find:查询s1中是否包含s2;如果包含返回第一次出现的位置 //如果没有;不会返回 if(t!=-1){ cout<<"yes"; } else{ cout<<"no" } return 0; }


Run Info:

Main.cc:5:1: error: 'string' does not name a type
 string s1,s2;
 ^
Main.cc: In function 'int main()':
Main.cc:9:10: error: 's1' was not declared in this scope
     cin>>s1>>s2;
          ^
Main.cc:9:14: error: 's2' was not declared in this scope
     cin>>s1>>s2;
              ^
Main.cc:18:5: error: expected ';' before '}' token
     }
     ^