#104. FizzBuzz变种:数组与字符串处理
FizzBuzz变种:数组与字符串处理
FizzBuzz Variant
Background
This is a slightly more difficult version of the famous FizzBuzz problem, which is sometimes given as a first problem for job interviews. Congcong is currently learning programming, and Dawei has assigned him a task to implement a variant of FizzBuzz.
Problem Description
This is a slightly more difficult version of the famous FizzBuzz problem, which is sometimes given as a first problem for job interviews. Consider the series of numbers beginning at and running up to but not including . For example, if and , the series is . Return a new array containing the string form of these numbers. However, for multiples of , use "Fizz" instead of the number; for multiples of , use "Buzz"; and for multiples of both and , use "FizzBuzz". In Java, will convert an or other type to its form. This version is a little more complicated than the usual version since you have to allocate and index into an array instead of just printing, and we vary the instead of just always doing .
Input Format
Input is given from standard input in the following format.
Output Format
Output is printed to standard output in the following format.
String representation of the resulting array
Sample
1 6
["1\