I'm doing this problem set "FizzBuzz", and my switch statement is giving me some problems, here's my code:
func fizzBuzz(n: Int) -> String {
switch n {
case n % 3 == 0: print("Fizz")
case n % 5 == 0: print("Buzz")
case n % 15 == 0:print("FizzBuzz")
}
return "(n)"
}
If you could provide me with pointers / hints, instead of giving me the correct code, that would be swell :D
I'd prefer solving it myself, but a few hints could get me out of this hole.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…