Skip to content

Instantly share code, notes, and snippets.

@mneko22
Created June 11, 2015 09:48
Show Gist options
  • Save mneko22/9d176fb9354355b595dd to your computer and use it in GitHub Desktop.
Save mneko22/9d176fb9354355b595dd to your computer and use it in GitHub Desktop.
一行でfizzbuzzぽい
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));
}
}
@mneko22
Copy link
Author

mneko22 commented Nov 30, 2015

クソソース

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment