Closed redocmath closed 2 years ago
Checked error: there are critical errors on the connections between if family statements (if, elif, else)
int n = toint(in())
for i in range(1, n+1, 1) { out(tostring(i)+": ") if (i % 15 == 0) { out("fizzbuzz") } else { if (i % 3 == 0) { out("fizz") } elif (i % 5 == 0) { out("buzz") } else { out("none") } } out("\n") }
- in
30
- output
1: none 2: none 3: fizz 4: none 5: buzz 6: fizz 7: none 8: none 9: fizz 10: buzz 11: none 12: fizz 13: none 14: none 15: fizzbuzz 16: none 17: none 18: fizz 19: none 20: buzz 21: fizz 22: none 23: none 24: fizz 25: buzz 26: none 27: fizz 28: none 29: none 30: fizzbuzz
- reported issue: the flow is strange
Fixed. 🚀