少儿信息学竞赛交流教学讲义.pptVIP

  • 9
  • 0
  • 约1.22万字
  • 约 69页
  • 2018-10-29 发布于天津
  • 举报
少儿信息学竞赛交流教学讲义.ppt

program test04(第三届); var i,j,s,h,v,n:integer; a:array[1..20,1..20] of integer; begin readln(n,h,v); for i:=1 to n do begin for j:=1 to n do read(a[i,j]);readln; end; s:=0; for i:=1 to n do if i=h then for j:=1 to n do s:=s+a[i,j]; for j:=1 to n do if j=v then for i:=1 to n do s:=s+a[i,j]; if h=v then for i:=1 to n-(v-h) do s:=s+a[i,i+v-h] else for j:=1 to n-(h-v) do s:=s+a[j+h-v,j]; for i:=1 to 2 do s:=s-a[h,v]; writeln(s); end. 输入: 8 5 3 2 16 18 5 13 13 14 0 3 15 19 14 12 16 5 11 9 1 5 6 1 14 7 5 1 2 6 5 2 12 4 8 3 13 10 1 10 1 12 18 1 5 0 1 4 6 18 0 19 15 7 4 0 2 12 1

文档评论(0)

1亿VIP精品文档

相关文档