主题:Pascal程序填空题,高手帮忙填空下!多谢了,抱佛脚!
下列程序的功能是输入一个长度为20的字符串,先输出,再将字符串间所有空格删除后再输出。
program ex;
Const n=20;
var a:array[1..20]of char;
i,j,k:integer;ch:char;
begin
writeln;
for i:=1 to n do_________
for j:=1 to 20 do write(a[j]:2);
i:=1;while____________________________do i:=i+1;
j:=j+1;
while j<=n do
begin
while (j<=n)and (a[j]='')do__________________
if _________________then
begin
ch:=a[1];a[1]:=a[j];a[j]:=ch;
end;
_________________;
end;
for i:=1 to n do write(a[i]);
writeln;
end.
共5个空,望高手赐教,不胜感激,救命!!
program ex;
Const n=20;
var a:array[1..20]of char;
i,j,k:integer;ch:char;
begin
writeln;
for i:=1 to n do_________
for j:=1 to 20 do write(a[j]:2);
i:=1;while____________________________do i:=i+1;
j:=j+1;
while j<=n do
begin
while (j<=n)and (a[j]='')do__________________
if _________________then
begin
ch:=a[1];a[1]:=a[j];a[j]:=ch;
end;
_________________;
end;
for i:=1 to n do write(a[i]);
writeln;
end.
共5个空,望高手赐教,不胜感激,救命!!