Sort by

recency

|

80 Discussions

|

  • + 0 comments

    x=0.88 y=1.55 Ca=160+40*(x+x**2) Cb=128+40*(y+y**2) print(round(Ca,3)) print(round(Cb,3))

  • + 1 comment
    from math import exp,factorial
    
    def thnks_for_the_fish(machine, cost):
        return sum((exp(-machine) * machine**k) / factorial(k) * (cost + 40 * k**2) for k in range(20))
    
    A,B = map(float,input().split(" "))
    
    print(round(thnks_for_the_fish(A, 160), 3))
    print(round(thnks_for_the_fish(B, 128), 3))
    
  • + 0 comments

    In R could be:

    stdin <- file('stdin')
    open(stdin)
    
    line <- as.numeric(strsplit(trimws(readLines(stdin, n = 1, warn = FALSE), which = "right"), " ")[[1]])
    cat(format(round(160 + 40*(line[1]+line[1]^2),3), nsmall=3), fill=TRUE)
    cat(format(round(128 + 40*(line[2]+line[2]^2),3), nsmall=3), fill=TRUE)
    
  • + 1 comment
    X,Y=map(float,input().split())
    print(round(160+(40*(X+X**2)),3))
    print(round(128+(40*(Y+Y**2)),3))
    
  • + 0 comments
    print(160 + 40*(0.88+0.88**2))
    print(128 + 40*(1.55+1.55**2))