b x h too ben !!!
2025-01-20 17:11:26
发布于:浙江
2阅读
0回复
0点赞
我就zhe说了嗷~~!!!!!!
#include<bits/stdc++.h>
using namespace std;
char s[110];
const int prime[25]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
int sum[26];
int main(){
int maxn=0,minn=110;
scanf("%s",s);
int len=strlen(s);
for(int i=0;i<len;i++){
sum[s[i]-'a'];
}
for(int i=0;i<26;i){
if(sum[i]>maxn) maxn=sum[i];
if(sum[i]>0&&sum[i]<minn) minn=sum[i];
}
for(int i=0;i<25;i++){
if(maxn-minn==prime[i]){
printf("Lucky Word\n%d",maxn-minn);
return 0;
}
}
printf("No Answer\n0");
return 0;
}
这里空空如也
有帮助,赞一个