Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Untitled
SUBMITTED BY:
Guest
DATE:
Nov. 11, 2013, 12:06 p.m.
FORMAT:
Text only
SIZE:
686 Bytes
Raw
Download
Tweet
HITS:
3314
Go to comments
Report
# -*- coding: utf-8 -*-
# Write your program under these comment lines
# Γράψτε το πρόγραμμά σας κάτω από αυτές τις γραμμές των σχολίων
def f(x):
return (-1)*(1/6.)*(x-1)*(x-2)*(x+2)*(x-4)
x1,x2,n = input()
while n!=0:
u = abs((x2 - x1))/ float(n)
S = 0
for i in range(0,n):
m1 = x1 + u*i
b = f(m1)
m2 = x1 + u*(i+1)
B = f(m2)
E = float((b+B))*u / 2.
S = S + E
print format(S, '.3f')
x1,x2,n = input()
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus