| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
为么就WA了呢。。。var
n,m,len,i,j,k:longint;
a:array[1..99999999]of integer;
begin
readln(n,m);
while n>0 do
begin
len:=0;
if m>0 then begin
while m>0 do
begin
inc(len);
a[len]:=m mod 10;
m:=m div 10;
end;
end else len:=1;
for i:=len downto 1 do
begin
if i<len then write(' ');
case a[i] of
1,4:for j:=1 to n+2 do
write(' ');
2,3,5,6,7,8,9,0:begin write(' ');
for j:=1 to n do write('-');
write(' '); end;
end;
end;
writeln;
for i:=1 to n do
begin
for j:=len downto 1 do
begin
if i<len then write(' ');
case a[j] of
1,2,3,7:begin for k:=1 to n+1 do write(' ');
write('|'); end;
5,6:begin write('|');
for k:=1 to n+1 do write(' '); end;
4,8,9,0:begin write('|');
for k:=1 to n do write(' ');
write('|'); end;
end;
end;
writeln;
end;
for i:=len downto 1 do
begin
if i<len then write(' ');
case a[i] of
1,7,0:for j:=1 to n+2 do
write(' ');
2,3,4,5,6,8,9:begin write(' ');
for j:=1 to n do write('-');
write(' '); end;
end;
end;
writeln;
for i:=1 to n do
begin
for j:=len downto 1 do
begin
if i<len then write(' ');
case a[j] of
1,3,4,5,7,9:begin for k:=1 to n+1 do write(' ');
write('|');end;
2:begin write('|');
for k:=1 to n+1 do write(' '); end;
6,8,0:begin write('|');
for k:=1 to n do write(' ');
write('|'); end;
end;
end;
writeln;
end;
for i:=len downto 1 do
begin
if i<len then write(' ');
case a[i] of
1,4,7:for j:=1 to n+2 do
write(' ');
2,3,0,5,6,8,9:begin write(' ');
for j:=1 to n do write('-');
write(' ');end;
end;
end;
writeln;
readln(n,m);
writeln;
end;
end.
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator