哪里錯了啊..
?public class HelloWorld{
? ? public static void ?main (String[]args) {
? ? ? double kx=78.5;
? ? ? int ? ?zx=5;
? ? ? double tx=k+z;
? ? ? System.out.println("考試平均分:"+kx)
? ? ? System.out.println("調整后平均分:"+tx) ? ?
? } ? ?
? }
?public class HelloWorld{
? ? public static void ?main (String[]args) {
? ? ? double kx=78.5;
? ? ? int ? ?zx=5;
? ? ? double tx=k+z;
? ? ? System.out.println("考試平均分:"+kx)
? ? ? System.out.println("調整后平均分:"+tx) ? ?
? } ? ?
? }
2017-02-13
舉報
2017-03-10
你后面兩條輸出代碼少了分號
2017-02-13
建議把int zx=5;改成double zc=5.0;
因為tx是double類型。計算機內部進行加法運算時會進行類型轉換,可能會丟失小數部分的數值。