Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
3485 邓程允 只出现一次的字符 C++ Compile Error 0 MS 0 KB 830 2024-06-08 18:10:06

Tests(0/0):


Code:

# include<iostream> using namespace std; int main(){ string a; int c[123]; cin>>a; for(int i=97;i<=122;i++){ for(int j=0;j<a.size();j++){ if(c[j]==char(i)){ c[i]++; } } } for(int b=97;b<=122;b++){ if(c[b]==1){ cout<<char(b); return 0; } } cout<<"no"; return 0; }# include<iostream> using namespace std; int main(){ string a; int c[123]; cin>>a; for(int i=97;i<=122;i++){ for(int j=0;j<a.size();j++){ if(c[j]==char(i)){ c[i]++; } } } for(int b=97;b<=122;b++){ if(c[b]==1){ cout<<char(b); return 0; } } cout<<"no"; return 0; }


Run Info:

Main.cc:22:2: error: stray '#' in program
 }# include
  ^
Main.cc: In function 'int main()':
Main.cc:8:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j=0;j
    ^
Main.cc: In function 'int main()':
Main.cc:24:5: error: redefinition of 'int main()'
 int main(){
     ^
Main.cc:3:5: error: 'int main()' previously defined here
 int main(){
     ^
Main.cc:29:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j=0;j<a.size();j++){
                              ^