Moving Average by teebee

a:[];n:0;i:0;stdin.get_s(4K).split("
"){a=a~[it.slice(7,11).to_f];n+=a[i]-(i>4?a[i-5]:0);++i;%f"%s Average: %.1f"(it,n/(i>4?5:i)).p;}

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

download

return to the top page