#104. FizzBuzz变种:数组与字符串处理

    ID: 104 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatArray-2gesp3一维数组字符串

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 startstart and running up to but not including endend. For example, if start=1start=1 and end=5end=5, the series is 1,2,3,41, 2, 3, 4. Return a new String[]String[] array containing the string form of these numbers. However, for multiples of 33, use "Fizz" instead of the number; for multiples of 55, use "Buzz"; and for multiples of both 33 and 55, use "FizzBuzz". In Java, String.valueOf(xxx)String.valueOf(xxx) will convert an intint or other type to its StringString 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 start/endstart/end instead of just always doing 1..1001..100.

Input Format

Input is given from standard input in the following format.

startstart endend

Output Format

Output is printed to standard output in the following format.

String representation of the resulting String[]String[] array

Sample

1 6
["1\