Last active
December 3, 2021 06:58
-
-
Save ntddk/7678ed6349a66e279843 to your computer and use it in GitHub Desktop.
code golf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// お題 | |
// http://togetter.com/li/92612 | |
// FizzBuzzを30バイトで | |
// my code | |
// 1. | |
//main(_){printf(_%15?_%3?_%5?"%d\n":"Buzz\n":"Fizz\n":"FizzBuzz\n",_);main(++_);} | |
// 80bytes | |
// 2. | |
main(_){printf(_%3?_%5?"%d":0:"Fizz",_);puts(_%5?"":"Buzz");main(++_);} | |
// 71bytes | |
// これは「1から100」までという縛りなし. | |
// 縛りありだと_++-100&&main(_)で伸びちゃうな. | |
// 例 | |
// 1. | |
// http://gsbina.com/?p=281 | |
// main(a){for(;a<101;puts(a++%5?"":"Buzz"))printf(a%3?a%5?"%d":0:"Fizz",a);} | |
// 75bytes | |
// 2. | |
// http://golf.shinh.org/p.rb?FizzBuzz#C | |
// 最短は73bytesっぽい.マジかよ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment