<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>40点未満の人を割り出す</title>
<script>
var count=0;
var data = [59, 39, 100, 2, 15, 40, 84, 97, 39, 41, 39.9, 40.1];
for(var i = 0;i<data.length;i++) {
document.write(data[i]+'<br>'); // 配列データの表示
if(data[i]<40){
count++;
}
}
document.write('<h1>40点未満の人は' + count + '人です</h1>'); // 40未満の数値の個数表示
</script>
</head>
<body>
</body>
</html>
More than 3 years have passed since last update.
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