by tehzord · 13y ago · 0 comments
class Solution{public static void main(String[] a){for(int i=0;++i<101;)System.out.println(i%15==0?"FizzBuzz":i%3==0?"Fizz":i%5==0?"Buzz":i);}}
143 characters, 57 scoreOTOH, in real world code I'm glad to see it gone.
Also just noticed the () on my import aren't needed, first one would have to be a space anyway but second one can be removed to get the character count down by one and a bit more jiggering of the if/else logic can shave another character:
package main
import o"fmt"
func main(){s:=o.Print
for i:=1;i<101;i++{if f,b:=i%3==0,i%5==0;(f||b){if f{s("Fizz")}
if b{s("Buzz")}}else{s(i)}
s("\n")}}