第22行非法开始表达

时间:2014-05-27 16:26:44

标签: java

我是初学者,我的第一个代码有问题。我只是想解决耦合轴对齐问题。

它说,"非法开始表达"。有人可以帮我解决这个问题吗?感谢

这是我的代码:

import java.util.Scanner;

public class Front {

     public static void main(String []args){

         Scanner input = new Scanner(System.in);

         Double A = input.nextDouble();
         Double B = input.nextDouble();
         Double C = input.nextDouble();
         Double S = input.nextDouble();
         Double M = input.nextDouble();             

         Double F = B / A * (S-M)/2 - S/2;

         System.out.println("The front foot is: " + F +); 
     }
}

1 个答案:

答案 0 :(得分:2)

您在+

中的上一个System.out.println("The front foot is: " + F +);之后错过了一个操作数

另一种选择是使用格式化输出:

System.out.printf("The front foot is: %f\n", F.floatValue());