比赛 |
暑假培训一 |
评测结果 |
C |
题目名称 |
字符串的展开 |
最终得分 |
0 |
用户昵称 |
书剑飘零 |
运行时间 |
0.000 s |
代码语言 |
Pascal |
内存使用 |
0.00 MiB |
提交时间 |
2008-07-17 11:12:33 |
显示代码纯文本
var fin,fou:text;p1,p2,p3:integer;
procedure init;
begin
assign(fin,'expand.in');reset(fin);
readln(fin,p1,p2,p3);
assign(fou,'expand.out');rewrite(fou);
end;
procedure main;
var ch,ch1,ch2,ch3,ch3bak:char;
i:longint;
begin
repeat
read(fin,ch1);write(fou,ch1);
until ch1<>'-';
while not(eof(fin)) do begin
read(fin,ch2);
if ch2='-' then begin
read(fin,ch3);ch3bak:=ch3;
if not(ok(ch1,ch3)) then begin write(fou,ch2,ch3);ch1:=ch3 end else begin
……
end else begin write(fou,ch2);ch1:=ch2;end;
close(fin);close(fou);
end;
if p1=1 then begin if (ch1>='A')and(ch1<='Z') then begin ch1:=chr(ord(ch1)+32);ch3:=chr(ord(ch3)+32);end;
if p3=1 then for ch:=chr(ord(ch1)+1) to chr(ord(ch3)-1) do
for i:=1 to p2 do write(fou,ch)
else for ch:=chr(ord(ch3)-1) downto chr(ord(ch1)+1) do
for i:=1 to p2 do write(fou,ch);
end;
if p1=2 then begin if (ch1>='a')and(ch1<='z') then begin ch1:=chr(ord(ch1)-32);ch3:=chr(ord(ch3)-32);end;
if p3=1 then for ch:=chr(ord(ch1)+1) to chr(ord(ch3)-1) do
for i:=1 to p2 do write(fou,ch)
else for ch:=chr(ord(ch3)-1) downto chr(ord(ch1)+1) do
for i:=1 to p2 do write(fou,ch);
end;
if p1=3 then begin
for ch:=chr(ord(ch1)+1) to chr(ord(ch3)-1) do
for i:=1 to p2 do write(fou,'*')
end;
write(fou,ch3bak);ch1:=ch3bak;