Skip to content

Latest commit

 

History

History
68 lines (44 loc) · 1.17 KB

File metadata and controls

68 lines (44 loc) · 1.17 KB

English Version

题目描述

写一个程序,输出从 1 到 n 数字的字符串表示。

1. 如果 是3的倍数,输出“Fizz”;

2. 如果 是5的倍数,输出“Buzz”;

3.如果 同时是3和5的倍数,输出 “FizzBuzz”。

示例:

n = 15,

返回:
[
    "1",
    "2",
    "Fizz",
    "4",
    "Buzz",
    "Fizz",
    "7",
    "8",
    "Fizz",
    "Buzz",
    "11",
    "Fizz",
    "13",
    "14",
    "FizzBuzz"
]

解法

Python3

Java

...