标签:
I tried Python:
def f(x,i,n,a,b,r,s,w): if(i>n):return r return f(x,i+1,n,a*x*x,b*2*i*(2*i+s),r+a*w/b,s,-w) n=int(input()) for _ in range(n): v=float(input()) print(("%.3f"%f(v,1,5,v,1,0,1,1)).rstrip(‘0‘)) print(("%.3f"%f(v,1,5,1,1,0,-1,1)).rstrip(‘0‘))
Looks like 1st on leatherboard is in Ruby.. ok, will try it next time.
HackerRank - The Trigonometric Ratios (Cold Golf)
标签:
原文地址:http://www.cnblogs.com/tonix/p/4431264.html