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 |
拉了半天,终于出来了var a:array[1..100,1..100]of char; c:char; i1,j1,m,n,ii,i,k,j,kl:integer; procedure print; var s,b:integer; begin if n=m then begin s:=m div 2; b:=n div 2+1; a[b,s]:=chr(ord(c)); end; for i1:=1 to m do begin for j1:=1 to n do write(' ',a[i1,j1]); writeln; end; end; procedure fuck; var k:integer; begin if n=m then begin if odd(n)then begin k:=m div 2+1; a[k,k]:=chr(64+n*n); end; end; end; function isfull:boolean; var i,j:integer; begin isfull:=true; for i:=1 to n do for j:=1 to m do if a[j,i]=' ' then isfull:=false; fuck; end; begin fillchar(a,sizeof(a),' '); readln(m,n); k:=1; j:=1; c:='@'; if m>n then kl:=n else kl:=m; for ii:=1 to kl div 2+1 do begin j:=ii; k:=ii; begin for i:=ii to n-ii do begin c:=chr(ord(c)+1); if isfull then break;; if ord(c)=91 then c:='A'; a[j,k]:=c; k:=k+1; end; for i:=ii to m-ii do begin c:=chr(ord(c)+1); if isfull then break; if ord(c)=91 then c:='A'; a[j,k]:=c; j:=j+1; end; for i:=ii to n-ii do begin c:=chr(ord(c)+1); if isfull then break; if ord(c)=91 then c:='A'; a[j,k]:=c; k:=k-1; end; for i:=ii to m-ii do begin c:=chr(ord(c)+1); if isfull then break; if ord(c)=91 then c:='A'; a[j,k]:=c; j:=j-1; end; end; end; print; end. Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator