Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
82681 石依灵 如何得到"hello" C++ Compile Error 0 MS 0 KB 363 2024-07-13 14:38:13

Tests(0/0):


Code:

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


Run Info:

Main.cc:1:2: error: stray '#' in program
 v#include 
  ^
Main.cc:1:1: error: 'v' does not name a type
 v#include 
 ^
Main.cc: In function 'int main()':
Main.cc:4:5: error: 'string' was not declared in this scope
     string a="hello";
     ^
Main.cc:5:5: error: 'sreing' was not declared in this scope
     sreing s;
     ^
Main.cc:7:5: error: 'cin' was not declared in this scope
     cin>>s;
     ^
Main.cc:7:10: error: 's' was not declared in this scope
     cin>>s;
          ^
Main.cc:9:18: error: 'a' was not declared in this scope
         if(s[i]==a[k]){
                  ^
Main.cc:13:17: error: 'cout' was not declared in this scope
                 cout<<"YES";
                 ^
Main.cc:17:6: error: 'cout' was not declared in this scope
     }cout<<"NO";
      ^