Advertisement
jresendiz27

fizz-buzz.groovy

Dec 9th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.13 KB | None | 0 0
  1. a = "";(1..100).each{b = it % 3 == 0;c = it % 5 == 0;if (b) a += "fizz";if (c) a += "buzz";if (!(b) && !(c)) a += it;a+="\n";};print a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement