<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>if&最大値を求める</title>
</head>
<body>
<script>
var rand1 = Math.floor(Math.random() * 101);
var rand2 = Math.floor(Math.random() * 101);
var rand3 = Math.floor(Math.random() * 101);
var max = Math.max(rand1, rand2, rand3);
document.write('<p>rand1: ' + rand1 + '</p>');
document.write('<p>rand2: ' + rand2 + '</p>');
document.write('<p>rand3: ' + rand2 + '</p>');
document.write('<p>一番大きい数値: ' + max + '</p>');
</script>
</body>
</html>
More than 5 years have passed since last update.
0~100のランダムな数値を3つ取得し、「それぞれの数値」と「一番大きい数値」の情報を表示してください。
Last updated at Posted at 2018-11-28
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme