fizzbuzz
fizzbuzz copied to clipboard
reduce print count per iteration
recudeprint.c
By changing the output count per iteration from 15 to 30, reduce the number of myitoa
calls from 8/15 to 3/30.
(The last digit is always the same for every iteration, so there is no need to output it by myitoa
.)
reduceandreuse.c
Combine reduceprint.c
& reusebuffer2.c
My machine's results.
reusebuffer2 5.119s
reduceprint 4.740s
reduceandreuse 4.167s