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 |
PASCAL 1ACvar i,j,r,c:integer; ave:real; a:array[0..100,0..100]of integer; s:string; begin readln(s); while s<>'ENDOFINPUT' do begin if s<>'END' then begin fillchar(a,sizeof(a),0); r:=ord(s[7])-48; c:=ord(s[9])-48; for i:=1 to r do begin readln(s); for j:=1 to c do a[i,j]:=ord(s[j])-48; end; for i:=2 to r do begin for j:=2 to c do begin ave:=(a[i,j]+a[i-1,j]+a[i,j-1]+a[i-1,j-1])/4; write(trunc(ave)); end; writeln; end; end; readln(s); end; end. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator