测评机: Xeond[6]
得分: 0分
提交日期: 2011-9-18 13:25:00
有效耗时: 该状态没有记录
RQNOJ近期在线比赛列表
RQNOJ九月份月赛 时间:2011-9-24 18:30:00 [报名]
测试结果1: 运行错误|无效浮点操作
测试结果2: 运行错误|无效浮点操作
测试结果3: 运行错误|无效浮点操作
测试结果4: 运行错误|无效浮点操作
测试结果5: 运行错误|无效浮点操作
测试结果6: 运行错误|无效浮点操作
测试结果7: 运行错误|无效浮点操作
测试结果8: 运行错误|无效浮点操作
测试结果9: 运行错误|无效浮点操作
测试结果10: 运行错误|无效浮点操作
提交代码: view sourceprint?
Program syw0029;
var s:string; maxn,minn,i,cha:integer; a:array['A'..'Z']of integer; j:char;
begin
read(s); maxn:=0; minn:=500;
for i:=1 to length(s) do inc(a[upcase(s[i])]);
fillchar(a,sizeof(a),0);
for j:='A' to 'Z' do
begin
if (a[j]>maxn) and (a[j]<>0) then maxn:=a[j];
if (a[j]<minn) and (a[j]<>0) then minn:=a[j];
end;
cha:=maxn-minn;
for i:=2 to trunc(sqrt(cha))+1 do
begin
if cha mod i=0 then begin writeln('Lucky Word'); write(cha); exit;end
end;
writeln('No Answer');
write('0');
end.