Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

then you'd get \n \n fizz\n \n buzz\n rather than fizz\n buzz\n


The canonical FizzBuzz wants

1\n2\nFizz\n4\nBuzz\n...\nFizzBuzz\n

If you did not print anything for some cases, you're right that it could not be unconditional (though it could still be done at the end with a flag).


oops, yes, my mistake.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: