题目说的就是给了cos(x) public class Main { public static void main(String[] args) { // double w = Math.PI*2/(20.0/3); double w = 1; double l = 5.0/3; double maxS = 0; for (double x = 0; x < l; x+=0.00001) { double h = Math.cos(w*x); if(maxS<h*x) maxS = h*x; } System.out.println(maxS*2); } } //1.1221926763553334