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(ConvertNumber(InputNum), InputNum)); } public static int ConvertNumber(string InputNum) { var TempStack = new Stack(); foreach (var Num in InputNum) TempStack.Push(int.Parse(Num.ToString())); var NumList = new List(); do { NumList.Add(TempStack.Pop()); } while (TempStack.Count != 0); int ReturnNum = 0; for (int i = 0; i < NumList.Count; i++) { ReturnNum += Convert.ToInt32(Math.Pow(4, i) * NumList[i]); } return ReturnNum; } public static string IsFizzBuzz(int Num, string InputNum) { if (Num % 3 == 0 && Num % 5 == 0) return "FizzBuzz"; if (Num % 3 == 0) return "Fizz"; if (Num % 5 == 0) return "Buzz"; return InputNum; } } }