4041nofoundGeoge @ 2024-03-31 14:51:51
问题在哪?
#include <bits/stdc++.h>
using namespace std;
int a[105];
int main()
{
string s;
cin>>s;
for(int i=0;i<=s.size()-1;i++)
{
a[s[i]-'a'+1]++;
}
for(int i=1;i<=26;i++)
{
if(a[i]==1)
{
cout<<(char)(i-1+'a');
return 0;
}
}
cout<<"no";
return 0;
}
by mc_xiexie @ 2024-03-31 14:55:17
@4041nofoundGeoge
不是按ascll码排的,是按在字符串中出现的顺序排的
by 4041nofoundGeoge @ 2024-03-31 14:57:34
所以因该改哪里?不会