Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
88765 | 陈昊然 | 如何得到"hello" | C++ | Runtime Error | 0 MS | 268 KB | 406 | 2024-08-21 11:23:16 |
#include<bits/stdc++.h> using namespace std; char a[51],d[51]; int h=0,e=0,l=0,o=0; int main(){ cin>>a; int n=strlen(a); for(int i=0;i<=n-1;i++){ if(a[i]=='h'){ h++; } if(a[i] == 'e'&&h>=1){ e++; } if(a[i] == 'l'&&e>=1){ l++; } if(a[i] == 'l'&&l>=1){ l++; } if(a[i] == 'o'&&l>=2){ cout<<"YES"; return 0; } } cout<<"NO"; return 0; }
Runtime Error:Segmentation fault