[leetcode-412-Fizz Buzz]
生活随笔
收集整理的這篇文章主要介紹了
[leetcode-412-Fizz Buzz]
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Write a program that outputs the string representation of numbers from 1 to n.
But for multiples of three it should output “Fizz” instead of the number and for the
multiples of five output “Buzz”.
For numbers which are multiples of both three and five output “FizzBuzz”.
Example:
n = 15,
Return:
[
"1",
"2",
"Fizz",
"4",
"Buzz",
"Fizz",
"7",
"8",
"Fizz",
"Buzz",
"11",
"Fizz",
"13",
"14",
"FizzBuzz"
]
?
轉載于:https://www.cnblogs.com/hellowooorld/p/6842297.html
總結
以上是生活随笔為你收集整理的[leetcode-412-Fizz Buzz]的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 微软 Build 2017 开发者大会:
- 下一篇: 解决 Android ping IPv6