讨论 / 哪里错了?大牛们解释解释
jerryR1 2009-03-27 03:13:00
点我顶贴 收藏 删除
var s:string;

i,j,n,m:longint;

begin

read(s);n:=0;m:=0;

for i:=1 to length(s) do

begin

if (s[i]>=’a’)and (s[i]<=’z’) then inc(n);

if (s[i]>=’A’) and (s[i]<=’Z’) then inc(m);

end;

if(m=4) then write(’4:0’);

if (m=3) then write(’4:0’);

if (m=2) then write(’3:1’);

if (m=1) then write(’1:1’);

if (m=0) then write(’0:4’);

end.

#1 jerryR1@2009-03-21 20:41:00
回复 删除
HH hh就是4:0
#2 wish@2009-03-21 20:41:00
回复 删除
这一题很奇妙的说

Mark

#3 wish@2009-03-21 20:47:00
回复 删除
请问你程序中n作用何在?

m 又怎么能超过2?

#4 hades@2009-03-27 03:13:00
回复 删除
晾程序玩

program jyy;

var

e:string;

a,b,x:integer;

begin

readln(e);

for a:=1 to 2 do begin

for b:= 4 to 5 do begin

if (e[a]=e[b]) and (e[b]>=’a’) and (e[b]<=’z’) then

x:=x+1;

end;

end;

if x=2 then writeln(’1:1’) else

writeln(4-x,’:’,x);

end.

查看更多回复
提交回复