Skip to content

Instantly share code, notes, and snippets.

@tomcha
Last active January 1, 2016 08:59
Show Gist options
  • Save tomcha/8121840 to your computer and use it in GitHub Desktop.
Save tomcha/8121840 to your computer and use it in GitHub Desktop.
javascriptでFizzBuzz書いてみた
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf8">
<script type="text/javascript">
var $html = "";
for (var i = 1; i <= 100; i++){
if( i % 15 == 0){
$html += "FizzBuzz<br>";
}else if( i % 3 == 0){
$html += "Fizz<br>";
}else if( i % 5 == 0){
$html += "Buzz<br>";
}else{
$html += i + "<br>";
}
}
document.write($html);
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment