Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
136906 田祥江 只出现一次的字符 C++ Compile Error 0 MS 0 KB 374 2025-11-15 16:18:47

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; bool a[30]; int main(){ string s; cin>>s; int len =s.size(); for(int i=0;i<len;i++){ int cnt=0; if(a[s[i]-'a']==1) continue; else a[s[i]-'a']=1; for(int j=0;j<len;j++){ if(s[i]==s[j]) cnt++; } if(cnt>1) continue; } if(cnt==1){ cout<<s[i]; return 0; } cout<<"no"; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:18:5: error: 'cnt' was not declared in this scope
  if(cnt==1){
     ^
Main.cc:19:11: error: 'i' was not declared in this scope
   cout<