要求:让用户输入车子的时速以及行驶的时间
求:一共行驶了多长时间
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
// 输入开车时速 开车时间 计算公里数
let g =prompt('请输入您车子的时速(公里/小时)')
let time =prompt('请输入您开了多长时间(h)')
function length(a,b){
document.write(`经过我详细的计算,您一共开了${a*b}公里数`)
}
length(g,time)
</script>
</body>
</html>