// Lab1.java STARTER FILE import java.io.*; // I/O import java.util.*; // Scanner class public class Lab1 { public static void main( String args[] ) throws Exception { final double MILES_PER_MARATHON = 26.21875; Scanner kbd = new Scanner (System.in); double aveMPH=0, aveMinsPerMile=0, aveSecsPerMile=0; System.out.print("Enter marathon time in hrs minutes seconds: "); //要在这里加入几段代码 System.out.println(); System.out.format("Average MPH was: %.2f mph\n", aveMPH ); System.out.format("Average mile split was %.0f mins %.1f seconds per mile", aveMinsPerMile, aveSecsPerMile ); System.out.println(); } }
如果要使上面这段代码最后输出成如图所示, 该怎么就添加代码呢
沫沫Michelle
相关分类