easyctf-2017/fizz-buzz-1/description.md

35 lines
496 B
Markdown
Raw Normal View History

2017-03-11 06:47:41 +00:00
Write a program that takes an integer `n` as input.
2017-03-11 06:47:41 +00:00
Output the numbers 1 through `n`, in increasing order, one per line.
However, replace any line that is a multiple of 3 with `Fizz` and any that are a multiple of 5 with `Buzz`. Any line that is a multiple of 3 and 5 should be written as `FizzBuzz`.
The input will be the number of lines to write, n, followed by a linebreak.
2017-03-11 06:47:41 +00:00
Sample input:
```
17
```
Sample output:
```
1
2
Fizz
4
Buzz
2017-03-11 06:47:41 +00:00
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
```