蒟蒻40求助
#include<iostream>
using namespace std;
int z[26];
int main(){
string a;
int x=0,y=0,b,c=0;
cin>>a;
for(int i=0;i<a.length();i++){
z[a[i]-97];
}
for(int i=0;i<26;i++){
if(a[i]>y){
if(a[i]>x){
y=x;
x=a[i];
}else{
y=a[i];
}
}
}
b=x-y;
if(b<2){
c=1;
}else{
for(int i=2;i*i<b;i++){
if(b%i==0){
c=1;
}
}
}
if(c==1){
cout<<"No Answer"<<endl<<"0";
return 0;
}else{
cout<<"Lucky Word"<<endl<<b;
return 0;
}
}
40分求助