- 找第一个只出现一次的字符
Pointer
- @ 2026-11-19 0:13:02
#include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
bool flag = 1;
getline(cin,s);
for(char &c : s)
{
for(char &a : s)
{
if(&a != &c && a == c)
{
flag = 0;
break;
}
}
if(flag)
{
cout<<c;
return 0;
}
else
{
flag = 1;
}
}
if(flag) cout<<"no";
return 0;
}
0 comments
No comments so far...
Information
- ID
- 608
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 5
- Tags
- (None)
- # Submissions
- 203
- Accepted
- 76
- Uploaded By