我想将此方法转换为一个循环,任何类型的循环都很好,我发现很难从递归转换。
public class Problem5
{
public double getRoot(double a, double b)
{
double x = (a + b)/2;
if (b - a <= 0.00)
return x;
double y = getValue(x);
if(y < 0)
return getRoot(x, b);
else
return getRoot(a, x);
}
答案 0 :(得分:0)
NSDocument *document = [SecondDocument new];
[document makeWindowControllers];
[[NSDocumentController sharedDocumentController] addDocument: document];
[document showWindows];