Numbers, Sums, Products

Python - 146 characters

g=[map(int,raw_input().split(' '))for i in' '*20]
r=range(18)
print max(reduce(int.__mul__,[sum(v[j:j+3])for v in g[i:i+3]])for j in r for i in r)

J, 38

":@(>./@,@(3*/\3+/\"1".;._2))&.stdin''

Sample use:

$ jconsole nsp.ijs <g1
3375
$ jconsole nsp.ijs <g2
328536000
$ jconsole nsp.ijs <g3
185193

Rough explanations:

  • ".;._2 converts raw input to matrix, ": converts the result to raw output
  • 3+/\"1 sums column-wise, 3 by 3
  • 3*/\ multiplies row-wise, 3 by 3
  • , flattens the result
  • >./ extracts the maximum
  • &.stdin'' makes a filter out of it

Java, 299 Chars

    class M{public static void main(String[]a){java.util.Scanner s=new java.util.Scanner(System.in);int i,j,k,p,m,t=20,x[][]=new int[t][t];for(i=m=0;i<t*t;i++)x[i/t][i%t]=s.nextInt();for(i=0;i<18;i++)for(j=0;j<18;j++,m=p>m?p:m)for(p=1,k=i;k<i+3;k++)p*=x[k][j]+x[k][j+1]+x[k][j+2];System.out.print(m);}}