football league standings by hallvabo

import sys
a=[]
for _ in sys.stdin:e,s=_.split(' ',1);z=map(int,s[::2]);x,y=z[::2],z[1::2];W,D,L=map(map(cmp,x,y).count,(1,0,-1));F,A=sum(x),sum(y);P=3*W+D;a+=chr(99-P)+e+"%3s"*8%(W+D+L,P,W,D,L,F,A,"%4s"%(' +'[F-A>0]+`F-A`)),
print' '*len(e),"   P Pt  W  D  L  F  A  GD"
for e in sorted(a):print L,e[1:];L+=1

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return top