Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
35713 | 奚晨瑞 | 找第一个只出现一次的字符 | C++ | Accepted | 0 MS | 248 KB | 372 | 2024-01-05 15:54:12 |
#include<iostream> #include<cstring> #include<cstdio> #include<cstdlib> using namespace std; int main() { char a[100002]; int s[26]={0}; cin>>a; for(int i=0;i<strlen(a);i++){ s[a[i]-'a']++; } bool flag=0; for(int i=0;i<=25;i++){ if(s[i]==1){ cout<<char(i+'a'); flag=1; break; } } if(flag==0){ cout<<"no"; } return 0; }