Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
7697 吴承熹 如何得到"hello" C++ Compile Error 0 MS 0 KB 800 2025-05-16 13:04:07

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ char a[11500]; int b=0,c=0,d=0,e=0; cin>>a; int i=0; while(a[i]!="\0"){ if(a[i]=='h'){ b++; continue; } if(a[i]=='e'){ c++; continue; } if(a[i]=='l'){ d++; continue; } } if(a[i]=='o'){ e++; continue; } } if(b<=1&&c<=1&&d<=2&&e<=1){ cout<<"YES"<<emdl; } else{ cout<<"NO"<<endl; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:12:17: warning: comparison with string literal results in unspecified behaviour [-Waddress]
     while(a[i]!="\0"){
                 ^
Main.cc:12:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
Main.cc:28:13: error: continue statement not within a loop
             continue;
             ^
Main.cc: At global scope:
Main.cc:31:5: error: expected unqualified-id before 'if'
     if(b<=1&&c<=1&&d<=2&&e<=1){
     ^
Main.cc:34:5: error: expected unqualified-id before 'else'
     else{
     ^
Main.cc:37:5: error: expected unqualified-id before 'return'
     return 0;
     ^
Main.cc:38:1: error: expected declaration before '}' token
 }
 ^