Tag: 最大的

如何找到变量集的最大值

我想知道是否有人可以帮助我找到一组变量的最大值并将它们分配给另一个变量。 这是我的代码片段,可能有助于理解我在说什么。 // Ask for quarter values. System.out.println(“What is the value of the first quarter?”); firstQuarter = input.nextDouble(); System.out.println(“What is the value of the second quarter?”); secondQuarter = input.nextDouble(); System.out.println(“What is the value of the third quarter?”); thirdQuarter = input.nextDouble(); System.out.println(“What is the value of the fourth quarter?”); fourthQuarter = input.nextDouble(); //Tell client the maximum […]