a=[0]*5 System.in.eachLine{s,i->a[i%5]=s[7..10]as Float printf s+" Average: %.1f\n",a.sum()/(i<5?i:5)}

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

download

return to the top page