怎么写这个做...而从C++到蟒蛇??
我看了很多主题,但我不明白如何使用这样的功能编写
do
{ L = 0; x = a; h = h / 2;
while (x < b) {
y1 = fC(x);
y2 = fC(x+h);
L = L + sqrt(h * h + (y2-y1) * (y2-y1));
x = x + h;
}
L = L * 2;
}
while (fabs(L0 - L) / L0 > 0.0001);
while True: # do --> while True:
L = 0
x = a
h = h / 2
while x < b:
y1 = fC(x)
y2 = fC(x+h)
L = L + sqrt(h * h + (y2-y1) * (y2-y1))
x = x + h
L = L * 2
if fabs(L0 - L) / L0 > 0.0001: break # do's while --> if ... : break