Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

#Java, 130 bytes

Java, 130 bytes

This is for recent Java versions (7+). In older ones you can shave some more off using the enum trick, but I don't think the logic gets any shorter than this (86 inside main).

class F{public static void main(String[]a){for(int i=0;i++<100;)System.out.println((i%3<1?"Fizz":"")+(i%5<1?"Buzz":i%3<1?"":i));}}

#Java, 130 bytes

This is for recent Java versions (7+). In older ones you can shave some more off using the enum trick, but I don't think the logic gets any shorter than this (86 inside main).

class F{public static void main(String[]a){for(int i=0;i++<100;)System.out.println((i%3<1?"Fizz":"")+(i%5<1?"Buzz":i%3<1?"":i));}}

Java, 130 bytes

This is for recent Java versions (7+). In older ones you can shave some more off using the enum trick, but I don't think the logic gets any shorter than this (86 inside main).

class F{public static void main(String[]a){for(int i=0;i++<100;)System.out.println((i%3<1?"Fizz":"")+(i%5<1?"Buzz":i%3<1?"":i));}}
Source Link
Geobits
  • 19.7k
  • 4
  • 56
  • 125

#Java, 130 bytes

This is for recent Java versions (7+). In older ones you can shave some more off using the enum trick, but I don't think the logic gets any shorter than this (86 inside main).

class F{public static void main(String[]a){for(int i=0;i++<100;)System.out.println((i%3<1?"Fizz":"")+(i%5<1?"Buzz":i%3<1?"":i));}}

AltStyle によって変換されたページ (->オリジナル) /