Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
70924 游四鑫 字符串包含判断 C++ Compile Error 0 MS 0 KB 360 2024-04-20 15:46:45

Tests(0/0):


Code:

#include<iostream> using namespace std; string a,b; int main(){ getline(cin,a); getline(cin,b); int s=a.size(); for(int q=1;q<a;q++){ if(a[i]==a[j]){ j++; if(j==s){ cout<<"yes"; return 0; } } else{ j==0; } } cout<<"no"; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:9:16: error: no match for 'operator<' (operand types are 'int' and 'std::__cxx11::string {aka std::__cxx11::basic_string}')
   for(int q=1;q constexpr bool std::operator<(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)
     operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
     ^
/usr/include/c++/5/bits/stl_pair.h:220:5: note:   template argument deduction/substitution failed:
Main.cc:9:17: note:   mismatched types 'const std::pair<_T1, _T2>' and 'int'
   for(int q=1;q bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
     operator<(const reverse_iterator<_Iterator>& __x,
     ^
/usr/include/c++/5/bits/stl_iterator.h:298:5: note:   template argument deduction/substitution failed:
Main.cc:9:17: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
   for(int q=1;q bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
     operator<(const reverse_iterator<_IteratorL>& __x,
     ^
/usr/include/c++/5/bits/stl_iterator.h:348:5: note:   template argument deduction/substitution failed:
Main.cc:9:17: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
   for(int q=1;q bool std::operator<(const std::move_iterator<_Iterator>&, const std::move_iterator<_IteratorR>&)
     operator<(const move_iterator<_IteratorL>& __x,
     ^
/usr/include/c++/5/bits/stl_iterator.h:1089:5: note:   template argument deduction/substitution failed:
Main.cc:9:17: note:   mismatched types 'const std::move_iterator<_Iterator>' and 'int'
   for(int q=1;q bool std::operator<(const std::move_iterator<_Iterator>&, const std::move_iterator<_Iterator>&)
     operator<(const move_iterator<_Iterator>& __x,
     ^
/usr/include/c++/5/bits/stl_iterator.h:1095:5: note:   template argument deduction/substitution failed:
Main.cc:9:17: note:   mismatched types 'const std::move_iterator<_Iterator>' and 'int'
   for(int q=1;q bool std::operator<(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/5/bits/basic_string.h:4987:5: note:   template argument deduction/substitution failed:
Main.cc:9:17: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'int'
   for(int q=1;q bool std::operator<(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)
     operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/5/bits/basic_string.h:4999:5: note:   template argument deduction/substitution failed:
Main.cc:9:17: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'int'
   for(int q=1;q bool std::operator<(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     operator<(const _CharT* __lhs,
     ^
/usr/include/c++/5/bits/basic_string.h:5011:5: note:   template argument deduction/substitution failed:
Main.cc:9:17: note:   mismatched types 'const _CharT*' and 'int'
   for(int q=1;q bool __gnu_cxx::operator<(const __gnu_cxx::__normal_iterator<_Iterator, _Container>&, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&)
     operator<(const __normal_iterator<_Iterator, _Container>& __lhs,
     ^
/usr/include/c++/5/bits/stl_iterator.h:856:5: note:   template argument deduction/substitution failed:
Main.cc:9:17: note:   mismatched types 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>' and 'int'
   for(int q=1;q bool __gnu_cxx::operator<(const __gnu_cxx::__normal_iterator<_IteratorL, _Container>&, const __gnu_cxx::__normal_iterator<_IteratorR, _Container>&)
     operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
     ^
/usr/include/c++/5/bits/stl_iterator.h:849:5: note:   template argument deduction/substitution failed:
Main.cc:9:17: note:   mismatched types 'const __gnu_cxx::__normal_iterator<_IteratorL, _Container>' and 'int'
   for(int q=1;q