mirror of
https://github.com/theoludwig/programming-challenges.git
synced 2025-05-18 12:02:53 +02:00
feat(challenges): add fizzbuzz
This commit is contained in:
34
challenges/fizzbuzz/README.md
Normal file
34
challenges/fizzbuzz/README.md
Normal file
@ -0,0 +1,34 @@
|
||||
# fizzbuzz
|
||||
|
||||
Created by [@Divlo](https://github.com/Divlo) on 30 June 2021.
|
||||
|
||||
## Instructions
|
||||
|
||||
Write a program that print the numbers from 1 to `n` but:
|
||||
|
||||
- if number is divisible by 3, print `Fizz`
|
||||
- if number is divisible by 5, print `Buzz`
|
||||
- if number is divisible by both 3 and 5, print `FizzBuzz`
|
||||
- otherwise print the number
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1
|
||||
|
||||
#### Input
|
||||
|
||||
```txt
|
||||
5
|
||||
```
|
||||
|
||||
#### Output
|
||||
|
||||
```txt
|
||||
1
|
||||
2
|
||||
Fizz
|
||||
4
|
||||
Buzz
|
||||
```
|
||||
|
||||
See the `test` folder for examples of input/output.
|
Reference in New Issue
Block a user