Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
160410 王润中 只出现一次的字符 C++ Runtime Error 0 MS 280 KB 307 2026-09-17 20:59:38

Tests(0/10):


Code:

#include<iostream> #include<cstring> using namespace std; int main(){ char a[100],b[100]; int p=0; cin>>a>>b; int l1=strlen(a); int l2=strlen(b); for(int i=0;i<l1;i++){ if(b[p]==a[i]){ p++; } else{ p=0; } } if(p==l2){ cout<<"yes"; } else{ cout<<"no"; } }


Run Info:

Runtime Error:Segmentation fault