Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
74642 牛延希 如何得到"hello" C++ Compile Error 0 MS 0 KB 257 2024-05-25 16:48:48

Tests(0/0):


Code:

# include<iostream> using namespace std; int main(){ int j=0; char a[114],b[114]={"hello"}; cin>>a; for(int i=0;a[i]!='\0';i++){ if(a[i]=b[j]) j++; if(j==4){ cout<<"YES"; return 0; } }cout<<"NO" return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:9:17: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
     if(a[i]=b[j])
                 ^
Main.cc:17:1: error: expected ';' before 'return'
 return 0;
 ^