using System; namespace Solution { class FizzBuzz { public static string Convert(int input) { var divisableBy3 = (input % 3 == 0); var divisableBy5 = (input % 5 == 0); return (!divisableBy3 & !divisableBy5) ? input.ToString() : (divisableBy3 ? "Fizz" : string.Empty) + (divisableBy5 ? "Buzz" : string.Empty); } } }
- using System;
- namespace Solution {
- class FizzBuzz {
- public static string Convert(int input)
- {
bool divisableBy3 = (input % 3 == 0);bool divisableBy5 = (input % 5 == 0);- var divisableBy3 = (input % 3 == 0);
- var divisableBy5 = (input % 5 == 0);
- return (!divisableBy3 & !divisableBy5) ? input.ToString()
: (divisableBy3 ? "Fizz" : "") + (divisableBy5 ? "Buzz" : "");- : (divisableBy3 ? "Fizz" : string.Empty) + (divisableBy5 ? "Buzz" : string.Empty);
- }
- }
- }