📜  在java代码示例中确定距离和时间的代码

📅  最后修改于: 2022-03-11 14:52:07.905000             🧑  作者: Mango

代码示例1
import java.util.Scanner;
import java.text.DecimalFormat;
import java.text.NumberFormat;
public class Lab3 {
    public static void main(String[] args) {
        int time = 0;
        int distance = 0;
        int speed = distance/time;
        float fval = speed * time;
        double dval = distance/speed;
        String message;
        Scanner scan = new Scanner(System.in);
        System.out.println("Please Enter Your Avaerage Speed: ");
        message = scan.nextLine();
        System.out.println("You Entered: \"" + message + "\"");
        System.out.println("Your Total Speed is: ");