3 ms·
Couldn't resist: 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)
by tehzord 14y ago
Couldn't resist:
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 score
- deleted 14y ago[deleted]
- georgemcbay 14y agoNice. Lack of the ternary operator is the big sticking point I have with really compact Go solutions. OTOH, 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")}}