讨论 / 为什么不AC
LIFE 2012-07-22 01:41:00
点我顶贴 收藏 删除
program lif;

const

se:set of char=[’a’..’z’,’A’..’Z’];

yin:set of char=[’a’,’e’,’i’,’o’,’u’,’A’,’E’,’I’,’O’,’U’];

var

i,j,len,total,tc,l:longint;

st:string;

flag:boolean;

begin

read (st);

len:=length (st);

for i:=l to len do

if st[i] in se then begin write(’.’); inc (tc); end

else write(st[i]); {suan sum letter}

writeln; {end fang’an yin}

if (tc/3-trunc(tc/3))>(trunc(tc/3)+l-tc/3) then

j:=trunc(tc/3)+l

else

j:=trunc(tc/3);

for i:=l to len do

begin

if st[i] in se then inc (total);

write(st[i]);

if total=j then break;

end;

for j:=i+l to len do

if st[j] in se then write(’.’)

else write(st[j]);

writeln; {end fang’an er}

total:=0;

for j:=i+l to len do

if (st[j] in yin) then flag:=true;

if flag then

begin

for j:=l to i do

write (st[j]);

for j:=i+l to len do

if (st[j] in yin) or not (st[j] in se) then write(st[j])

else write (’.’);

writeln

end

else

begin

if (2*tc/3-trunc(2*tc/3))>(trunc(2*tc/3)+l-2*tc/3) then

j:=trunc(2*tc/3)+l

else

j:=trunc(2*tc/3);

for i:=l to len do

begin

if st[i] in se then inc (total);

write(st[i]);

if total=j then break;

end;

for j:=i+l to len do

if st[j] in se then write(’.’)

else write(st[j]);

writeln; {end fang’an san}

end;

end.

#1 郑执@2012-07-22 01:41:00
回复 删除
你的L没有赋值为一,所以错了。还有,你是C为什么会用PASCAL?
查看更多回复
提交回复