Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
658 xishuai15 笨小猴 C++ 解答错误 0 MS 252 KB 543 2022-05-21 19:59:59

Tests(1/10):


#include<bits/stdc++.h> using namespace std; int ton[200], x=1, y=1, z, k=0; int main(){ char a[200]; memset(a,0,sizeof(a)); cin>>a; for(int i=0;i<strlen(a);i++){ ton[a[i]]++; } for(int i=97;i<123;i++){ if(ton[i]<x&&ton[i]!=0){ x=ton[i]; } if(ton[i]>y){ y=ton[i]; } } z=y-x; //cout<<"z="<<z<<endl<<x<<" "<<y; for(int i=2;i<=z;i++){ if(z%i==0){ if(z==i){ k=1; } else k=0; } } if(k==1){ cout<<"Lucky Word"<<endl<<z; } else cout<<"No Answer"<<endl<<z; return 0; }


测评信息: