using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; namespace _4FizzBuzz { class Program { static void Main() { string InputNum = Console.ReadLine(); Console.WriteLine(IsFizzBuzz(InputNum)); } public static bool IsModThree(string InputNum) { int PlusNum = 0; foreach (var Num in InputNum) PlusNum += Convert.ToInt32(Num.ToString()); if (PlusNum % 3 == 0) return true; else return false; } public static bool IsModFive(string InputNum) { int LastNum = Convert.ToInt32(InputNum.Substring(InputNum.Length - 1, 1)); if (LastNum % 5 == 0) return true; else return false; } public static string IsFizzBuzz(string InputNum) { bool IsThree = IsModThree(InputNum); bool IsFive = IsModFive(InputNum); if (IsThree && IsFive) return "FizzBuzz"; if (IsThree) return "Fizz"; if (IsFive) return "Buzz"; return InputNum; } } }