NOIP2008普及组复赛第4题标程大神们帮帮忙求NOIP2008普及组复赛第4题标程

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/25 23:30:54
NOIP2008普及组复赛第4题标程大神们帮帮忙求NOIP2008普及组复赛第4题标程NOIP2008普及组复赛第4题标程大神们帮帮忙求NOIP2008普及组复赛第4题标程NOIP2008普及组复赛第

NOIP2008普及组复赛第4题标程大神们帮帮忙求NOIP2008普及组复赛第4题标程
NOIP2008普及组复赛第4题标程大神们帮帮忙
求NOIP2008普及组复赛第4题标程

NOIP2008普及组复赛第4题标程大神们帮帮忙求NOIP2008普及组复赛第4题标程
Program drawing; Var a:array[1..50,1..50]of integer; map:array[1..1000,1..1000]of char; x,y,m,n,i,j,k,maxx,maxy,temp,tmp:integer; Procedure ready; Begin For i:=1 to maxx do For j:=1 to maxy do map[i,j]:='.'; End; Procedure print; Begin For x:=1 to maxx do Begin For y:=1 to maxy do write(map[x,y]); writeln; End; End; Procedure draw(x,y:integer); Begin map[x,y]:='+';map[x,y+1]:='-';map[x,y+2]:='-';map[x,y+3]:='-';map[x,y+4]:='+'; dec(x); map[x,y]:='|';map[x,y+1]:=' ';map[x,y+2]:=' ';map[x,y+3]:=' ';map[x,y+4]:='|';map[x,y+5]:='/'; dec(x); map[x,y]:='|';map[x,y+1]:=' ';map[x,y+2]:=' ';map[x,y+3]:=' ';map[x,y+4]:='|';map[x,y+5]:=' ';map[x,y+6]:='+'; dec(x); map[x,y]:='+';map[x,y+1]:='-';map[x,y+2]:='-';map[x,y+3]:='-';map[x,y+4]:='+';map[x,y+5]:=' ';map[x,y+6]:='|'; dec(x); map[x,y+1]:='/';map[x,y+2]:=' ';map[x,y+3]:=' ';map[x,y+4]:=' ';map[x,y+5]:='/';map[x,y+6]:='|'; dec(x); map[x,y+2]:='+';map[x,y+3]:='-';map[x,y+4]:='-';map[x,y+5]:='-';map[x,y+6]:='+'; End; Begin assign(input,'drawing.in'); assign(output,'drawing.out'); reset(input);rewrite(output); readln(m,n); For i:=1 to m do Begin For j:=1 to n do read(a[i,j]); readln; End; maxy:=4*n+2*m+1; maxx:=0; For i:=1 to m do Begin tmp:=a[i,1]; For j:=1 to n do If a[i,j]>tmp Then tmp:=a[i,j]; tmp:=tmp*3+(m-i+1)*2+1; If tmp>maxx Then maxx:=tmp; End; ready; For i:=1 to m do For j:=1 to n do Begin x:=maxx-(m-i)*2; y:=(j-1)*4+(m-i)*2+1; temp:=x; For k:=1 to a[i,j] do Begin draw(x,y); x:=x-3; End; x:=temp; End; print; close(input);close(output); End.