aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/old/examples/fizz_buzz.v
blob: 331046087144ab37b7376043685276b2f63bdb34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
fn main() {
	mut s := ''
	for n in 1 .. 101 {
		if n % 3 == 0 {
			s += 'Fizz'
		}
		if n % 5 == 0 {
			s += 'Buzz'
		}
		if s == '' {
			println(n)
		} else {
			println(s)
		}
		s = ''
	}
}