Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
61337 | lixinyu | 找第一个只出现一次的字符 | C++ | Accepted | 0 MS | 252 KB | 267 | 2025-02-28 15:37:03 |
#include<bits/stdc++.h> using namespace std; int main() { char a[100005]; cin>>a; int b[26]; for(int i=0;i<strlen(a);i++){ b[a[i]-'a']++; } for(int i=0;i<strlen(a);i++){ if(b[a[i]-'a']==1) { cout<<a[i]; return 0; } } return 0; }