Masala #4PN4F9OG1M

Xotira 32 MB Vaqt 1000 ms
14
Muallif: ....

FizzBuzz #2

Given an integer n, for every integer i <= n, the task is to print “FizzBuzz” if i is divisible by 3 and 5, “Fizz” if i is divisible by 3, “Buzz” if i is divisible by 5 or i (as a string) if none of the conditions are true.


Kiruvchi ma'lumotlar:

N kirib keladi


Chiquvchi ma'lumotlar:

Javob ni chop eting


Misollar
# input.txt output.txt
1
3
1 2 Fizz
Izoh:

Iterate on the given number from 1 to n, check its divisibility and add the string into result according to the given condition.