Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
82646 刘泽熙 如何得到"hello" C++ Compile Error 0 MS 0 KB 290 2024-07-13 14:31:13

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ string s; string a"hello"; int c=0; int k=0; cin>>s; for(int i=0;i<s.size();i++){ if(s[i]==a[k]){ c++; k++; } if(c==5){ cout<<"YES"; } } cout<<"NO"; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:5:13: error: expected initializer before string constant
     string a"hello";
             ^
Main.cc:9:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i=0;i