174 条题解
-
0沉默々泽 LV 8 @ 2009-08-22 09:36:35
为什么说我格式不对啊?
输出要注意些什么!help! -
02009-08-16 21:13:06@
var
s:string;
len:integer;
n,i,j,k,l,code:integer;
begin
readln(n);
readln(s);
len:=length(s);
for j:=1 to 3+n*2 do
for i:=1 to len do
begin
val(s[i],l,code);
case l of
0:
begin
if (j=1)or(j=3+n*2) then
begin
for k:=1 to n+2 do
if k=1
then write(' ')
else if k=n+2
then write(' ')
else write('-')
end
else if j=2+n
then for k:=1 to n+2 do write(' ')
else begin
for k:=1 to n+2 do
if k=1
then write('|')
else if k=n+2
then write('|')
else write(' ');
end;
if ilen
then write(' ')
else writeln
end;1:
begin
if (j=1)or(j=2+n)or(j=3+n*2)
then begin
for k:=1 to n+2 do write(' ')
end
else
for k:=1 to n+2 do
if k=n+2
then write('|')
else write(' ');
if ilen
then write(' ')
else writeln
end;
2:
begin
if (j=1)or (j=2+n)or(j=3+n*2)
then
for k:=1 to n+2 do
if (k=1)or(k=n+2)
then write(' ')
else write('-')
else if (j>1)and(j2+n)and(j1)and(jn+2)and(j1)and(j1)and(j1)and(j -
02009-08-16 20:52:51@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0msvar
n:array [0..9] of string;
s:string;
i,j,k,l,m,c:longint;
begin
read(m);
readln;
read(s);
l:=length(s);
c:=m+2;for i:=0 to 9 do
if (i=2)or(i=3)or(i=5)or(i=6)or(i=7)or(i=9)or(i=8)or(i=0) then
for j:=1 to m do n[i]:=n[i]+'-'
else for j:=1 to m do n[i]:=n[i]+' ';
for i:=1 to l do
begin
if i=l then
write(' ',n[ord(s[i])-ord('0')],' ') else
write(' ',n[ord(s[i])-ord('0')],' ');
end;
writeln;for i:=0 to 9 do
n[i]:='';
for i:=0 to 9 do
begin
if (i=1)or(i=2)or(i=3)or(i=7) then
begin
for j:=1 to c-1 do n[i]:=n[i]+' ';
n[i]:=n[i]+'|';
end
else if (i=5)or(i=6) then
begin
n[i]:=n[i]+'|';
for j:=2 to c do n[i]:=n[i]+' ';
end
else
begin
n[i]:=n[i]+'|';
for j:=2 to c-1 do n[i]:=n[i]+' ';
n[i]:=n[i]+'|';
end;
end;
for j:=1 to m do
begin
for i:=1 to l do
begin
if i=l then
write(n[ord(s[i])-ord('0')])
else write(n[ord(s[i])-ord('0')],' ');
end;
writeln;
end;for i:=0 to 9 do
n[i]:='';
for i:=0 to 9 do
if (i=2)or(i=3)or(i=5)or(i=6)or(i=4)or(i=9)or(i=8) then
for j:=1 to m do n[i]:=n[i]+'-'
else for j:=1 to m do n[i]:=n[i]+' ';
for i:=1 to l do
begin
if i=l then write(' ',n[ord(s[i])-ord('0')],' ') else
write(' ',n[ord(s[i])-ord('0')],' ');
end;
writeln;for i:=0 to 9 do
n[i]:='';
for i:=0 to 9 do
begin
if (i=1)or(i=4)or(i=3)or(i=7)or(i=5)or(i=9) then
begin
for j:=1 to c-1 do n[i]:=n[i]+' ';
n[i]:=n[i]+'|';
end
else if (i=2) then
begin
n[i]:=n[i]+'|';
for j:=2 to c do n[i]:=n[i]+' ';
end
else
begin
n[i]:=n[i]+'|';
for j:=2 to c-1 do n[i]:=n[i]+' ';
n[i]:=n[i]+'|';
end;
end;
for j:=1 to m do
begin
for i:=1 to l do
begin
if i=l then
write(n[ord(s[i])-ord('0')])
else write(n[ord(s[i])-ord('0')],' ');
end;
writeln;
end;
for i:=0 to 9 do
n[i]:='';
for i:=0 to 9 do
if (i=2)or(i=3)or(i=5)or(i=6)or(i=9)or(i=8)or(i=0) then
for j:=1 to m do n[i]:=n[i]+'-'
else for j:=1 to m do n[i]:=n[i]+' ';
for i:=1 to l do
begin
if i=l then write(' ',n[ord(s[i])-ord('0')],' ') else
write(' ',n[ord(s[i])-ord('0')],' ');
end;
end.一模一样的程序,提交2次,一次格式错误一次AC……
-
02009-08-16 20:14:08@
var
s:string;
len:integer;
n,i,j,k,l,code:integer;
begin
readln(n);
readln(s);
len:=length(s);
for j:=1 to 3+n*2 do
for i:=1 to len do
begin
val(s[i],l,code);
case l of
0:
begin
if (j=1)or(j=3+n*2) then begin
for k:=1 to n+2 do
if k=1 then write(' ')
else if k=n+2 then write(' ')
else write('-')
end
else if j=2+n then
for k:=1 to n+2 do write(' ')
else begin
for k:=1 to n+2 do
if k=1 then write('|')
else if k=n+2 then write('|')
else write(' ');
end;
if ilen then write(' ') else writeln
end;
1:
begin
if (j=1)or(j=2+n)or(j=3+n*2) then begin
for k:=1 to n+2 do write(' ')
end
else for k:=1 to n+2 do
if k=n+2 then write('|')
else write(' ');
if ilen then write(' ') else writeln
end;
2:
begin
if (j=1)or (j=2+n)or(j=3+n*2) then
for k:=1 to n+2 do
if (k=1)or(k=n+2) then write(' ')
else write('-')
else if (j>1)and(j2+n)and(j1)and(jn+2)and(j1)and(j1)and(j1)and(j -
02009-09-25 21:55:56@
var k,n,l,i,j:integer;
f:array[1..255]of integer;
s:string;
procedure print(i,j:integer);
var ii:integer;
begin
if (j=1)or(j=n)or(j=2+k) then
if (i=1)or((i=4)and(j2+k))or((i=7)and(j1))or((i=0)and(j=2+k))then
for ii:=1 to k+2 do write(' ')
else begin
write(' ');
for ii:=1 to k do write('-');
write(' ');
end
else
if j -
02009-08-13 19:11:51@
var k,n,l,i,j:integer;
f:array[1..255]of integer;
s:string;
procedure print(i,j:integer);
var ii:integer;
begin
if (j=1)or(j=n)or(j=2+k) then
if (i=1)or((i=4)and(j2+k))or((i=7)and(j1))or((i=0)and(j=2+k))then
for ii:=1 to k+2 do write(' ')
else begin
write(' ');
for ii:=1 to k do write('-');
write(' ');
end
else
if j -
02009-08-12 09:02:36@
这题.题目阴...题解也阴.............
特判下第一个不输出空格就可以了..
还有像'6'在行末时上面部分不是只输出'|'而是要连后面的空格全输出来..也就是应该要输出'| '(有空格)... -
02009-08-12 07:46:11@
什么 格式啊
-
02009-08-10 20:36:34@
弱弱的水题
一次AC -
02009-08-06 15:30:35@
P1064=水+阴险;
-
02009-08-04 11:13:37@
下面的样例应放入记事本中看
3
1|
|
||
|
| -
02009-08-03 22:35:31@
什么乱七八糟的格式……………………………………
-
02009-08-01 17:29:14@
此水为好水
-
02009-07-29 10:39:34@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0ms
#include
#include
char b[10][7]={"|-| ||-"," | | "," -|-| -"," -|- |-","| |- | ","|- - |-","|- -||-"," -| | ","|-|-||-","|-|- |-"};
char s[256];
int i,j,k,n,h;
int main()
{
scanf("%d",&k);
scanf("%s",s+1);
n=strlen(s+1);
for(i=1;i -
02009-07-25 23:04:14@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0ms
一次AC,用const一个一个列,此乃极品好题,乃图形题之上上之选,和立体图一样,美不胜收 -
02009-07-19 12:24:32@
80分了2次,终于AC……(其实是我忘记看0的输出结果)
关键是细心啊……
原来我想一大堆的case来弄……发现太长了,而且很丑,放弃了。。做的时候我把每个数输出的情况分了类(既当第i个数输出到j行时会怎么输),还不算太长。。。虽然看起来有点诡异。。var k,n,l,i,j:integer;
f:array[1..255]of integer;
s:string;
procedure print(i,j:integer);
var ii:integer;
begin
if (j=1)or(j=n)or(j=2+k) then
if (i=1)or((i=4)and(j2+k))or((i=7)and(j1))or((i=0)and(j=2+k))then
for ii:=1 to k+2 do write(' ')
else begin
write(' ');
for ii:=1 to k do write('-');
write(' ');
end
else
if j -
02009-07-07 21:06:09@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0ms
program ex;
var k,i,n,t:integer;
ss1,ss2,ss3,ss4,ss5:string;
s:array[1..100] of char;
a:array[1..100] of string;
begin
readln(k);
fillchar(a,sizeof(a),' ');
n:=0;
while not eoln do
begin
inc(n);
read(s[n]);
end;
ss1:=' ';
for i:=1 to k+1 do ss1:=ss1+' ';
ss2:=' ';
for i:=1 to k do ss2:=ss2+' ';
ss2:=ss2+'|';
ss3:=' ';
for i:=1 to k do ss3:=ss3+'-';
ss3:=ss3+' ';
ss4:='|';
for i:=1 to k+1 do ss4:=ss4+' ';
ss5:='|';
for i:=1 to k do ss5:=ss5+' ';
ss5:=ss5+'|';t:=1;
while t -
02009-06-27 17:43:26@
样例真的没有问题(只要将样例拷到 记事本 里面就知道了 )
最后那个空格应该是换行符或者别的什么 ASCII值 -
02009-05-28 18:13:02@
program num5;
var s:string;
a:array[1..300]of integer;
k,n,i,j,i2:longint;begin
readln(k);
readln(s);
n:=length(s);
for i:=1 to n do
a[i]:=ord(s[i])-48;
for i:=1 to n do
begin
case a[i] of
1,4:for j:=1 to k+2 do write(' ');
2,3,5,6,7,8,9,0:begin
write(' ');
for j:=1 to k do write('-');
write(' ');
end;
end;
if in then write(' ') else writeln;
end;
for i2:=1 to k do
begin
for i:=1 to n do
begin
case a[i] of
1,2,3,7:begin
for j:=1 to k+1 do write(' ');
write('|');
end;
4,8,9,0:begin
write('|');
for j:=1 to k do write(' ');
write('|');
end;
5,6:begin
write('|');
for j:=1 to k+1 do write(' ');
end;
end;
if in then write(' ') else writeln;
end;
end;
for i:=1 to n do
begin
case a[i] of
2,3,4,5,6,8,9:begin
write(' ');
for j:=1 to k do write('-');
write(' ');
end;
1,7,0:for j:=1 to k+2 do write(' ');
end;
if in then write(' ') else writeln;
end;
for i2:=1 to k do
begin
for i:=1 to n do
begin
case a[i] of
1,3,4,5,7,9:begin
for j:=1 to k+1 do write(' ');
write('|');
end;
2:begin
write('|');
for j:=1 to k+1 do write(' ');
end;
6,8,0:begin
write('|');
for j:=1 to k do write(' ');
write('|');
end;
end;
if in then write(' ') else writeln;
end;
end;
for i:=1 to n do
begin
case a[i] of
2,3,5,6,8,9,0:begin
write(' ');
for j:=1 to k do write('-');
write(' ');
end;
1,4,7:for j:=1 to k+2 do write(' ');
end;
if in then write(' ') else writeln;
end;
end.秒了。。。。。。。爆长的程序。。。。。
-
02009-05-11 13:01:14@
编译通过...
├ 测试数据 01:运行超时|格式错误...
├ 测试数据 02:运行超时|格式错误...
├ 测试数据 03:运行超时|格式错误...
├ 测试数据 04:运行超时|格式错误...
├ 测试数据 05:运行超时|格式错误...
├ 测试数据 06:运行超时|格式错误...
├ 测试数据 07:运行超时|格式错误...
├ 测试数据 08:运行超时|格式错误...
├ 测试数据 09:运行超时|格式错误...
├ 测试数据 10:运行超时|格式错误...
---|---|---|---|---|---|---|---|-
为什么