Chủ Nhật, 17 tháng 5, 2020

Algorithm example: Implementing FizzBuzz

Write an algorithm that prints all numbers between 1 and n, replacing multiples of 3 with the StringFizz, multiples of 5 with Buzz, and multiples of 15 with FizzBuzz.

-> lưu ý nhỏ là phải check 15 trước. vì nếu 1 số chia hết cho 15 thì cũng chia hết cho 5 và 3

Abstraction with FizzBuzz


Happy coding

thelam92

0 nhận xét:

Đăng nhận xét