Created
June 11, 2015 09:48
-
-
Save mneko22/9d176fb9354355b595dd to your computer and use it in GitHub Desktop.
一行でfizzbuzzぽい
This file contains 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
import java.io.IOException; | |
public class OneLinerFizzBuzz { | |
public static void main(String[] args) throws IOException { | |
for (int i = 1; i <= Integer.parseInt(args[0]); i++)System.out.printf("%s\n", i % 3 == 0 ? i % 5 == 0 ? "fizzbuzz": "fizz" : i % 5 == 0 ? "buzz" : String.valueOf(i)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
クソソース