因为你的输出里面也没有写呀应该改成System.out.println("合计(元) " + add1);System.out.println("合计(元) " + add2)
应该是这样子写:printf("合计(元) %f",add1);printf("惠计(元) %d",add2);