社区讨论
C++ 70分
B2110找第一个只出现一次的字符参与者 2已保存回复 2
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 2 条
- 当前快照
- 1 份
- 快照标识符
- @lo2kihpo
- 此快照首次捕获于
- 2023/10/23 15:20 2 年前
- 此快照最后确认于
- 2023/10/23 15:20 2 年前
CPP
#include<bits/stdc++.h>
using namespace std;
int ans;
int p[105];
bool flag;
int main()
{
string a;
getline(cin,a);
for(int i=0;i<a.length();i++)
{
p[(int)(a[i])]++;
}
for(int i=0;i<a.length();i++)
{
if(p[(int)(a[i])]==1)
{
cout<<a[i];
return 0;
}
}
if(!flag) cout<<"no";
return 0;
}
前3个点没过......
回复
共 2 条回复,欢迎继续交流。
正在加载回复...