Masala #4PN4F9OG1M
  
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.
Yechimini yuborish
Bu amalni bajarish uchun tizimga kiring,
agar profilingiz bo'lmasa istalgan payt ro'yxatdan o'tishingiz mumkin