r/shittyprogramming • • Oct 06 '21
FizzBuzz compact version
fn main(){for num in 1..101{if num%5==0&&num%3==0{println!("FizzBuzz")}else if num%5==0{println!("Buzz")}else if num%3==0{println!("Fizz")}else{println!("{}",num)}}}
51
Upvotes
View all comments
Show parent comment
20
u/AlcomIsst Oct 07 '21
Here's a 1 character solution in gs2