FizBuzz program: how to make the output correct?

后端 未结 4 418
梦谈多话
梦谈多话 2021-01-24 15:51

I got a question about this program, it says: The FizzBuzz Challenge: Display numbers from 1 to x, replacing the word \'fizz\' for multiples of 3, \'buzz\' for multiples

4条回答
  •  梦谈多话
    2021-01-24 16:50

    Hm, I think I'll only hint:

    1. Think of the correct order: What happens if a number is a multiple of 3, but also of (3 and 5)?
    2. There is an else if statement.

提交回复
热议问题