Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand FizzBuzzWhizz

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces the relevant knowledge of "how to understand FizzBuzzWhizz". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

You are a PE teacher, and when there are still five minutes before the end of a class, you decide to play a game. There are 100 students in class at this time. The rules of the game are:

1. You first name three different special numbers, which must be single digits, such as 3, 5, and 7.

two。 Ask all the students to shoot in a team, and then count in order.

3. When students count, if the number reported is a multiple of the first special number (3), then you can't say the number, but say Fizz; if the number reported is a multiple of the second special number (5), then say Buzz; if the number reported is a multiple of the third special number (7), then say Whizz.

4. When students report numbers, if the numbers reported are multiples of two special numbers at the same time, they should also be given special treatment, such as the first special number and the second special number, then they should not say the number, but FizzBuzz, and so on. If it is a multiple of three special numbers at the same time, then say FizzBuzzWhizz.

5. When students count, if the number reported contains the first special number, then you can't say the number, but say the corresponding word. For example, in this case, the first special number is 3, then the student who wants to report 13 should say Fizz. If the number contains the first special number, ignore rule 3 and rule 4, for example, students who want to report 35 only report Fizz, not BuzzWhizz.

Public class NumberTuil {public static String [] getTuil (int arecint breint c int n) {String [] t = new String [n]; for (int item1)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report