0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

0~100のランダムな数値を3つ取得し、「それぞれの数値」と「一番大きい数値」の情報を表示してください。

Last updated at Posted at 2018-11-28
<!DOCTYPE html>
<html lang="ja">
<head>
   <meta charset="UTF-8">
   <title>if&amp;最大値を求める</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>
0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?