Generalized FizzBuzz

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Input:
[n]
[mod1] [str1]
[mod2] [str2]
...

Output:
Print the numbers from 1 to n. If the number is divisible by any of mod1, mod2, etc. then print the corresponding string(s) instead.

Options

exec is denied

no deadline, the server will not save your submission

Sample input:_

100
3 Fizz
5 Buzz

Sample output:

1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
Buzz
Fizz
22
23
Fizz
Buzz
26
Fizz
28
29
FizzBuzz
31
32
Fizz
34
Buzz
Fizz
37
38
Fizz
Buzz
41
Fizz
43
44
FizzBuzz
46
47
Fizz
49
Buzz
Fizz
52
53
Fizz
Buzz
56
Fizz
58
59
FizzBuzz
61
62
Fizz
64
Buzz
Fizz
67
68
Fizz
Buzz
71
Fizz
73
74
FizzBuzz
76
77
Fizz
79
Buzz
Fizz
82
83
Fizz
Buzz
86
Fizz
88
89
FizzBuzz
91
92
Fizz
94
Buzz
Fizz
97
98
Fizz
Buzz

Sample input:_

200
7 Seven
11 Eleven

Sample output:

1
2
3
4
5
6
Seven
8
9
10
Eleven
12
13
Seven
15
16
17
18
19
20
Seven
Eleven
23
24
25
26
27
Seven
29
30
31
32
Eleven
34
Seven
36
37
38
39
40
41
Seven
43
Eleven
45
46
47
48
Seven
50
51
52
53
54
Eleven
Seven
57
58
59
60
61
62
Seven
64
65
Eleven
67
68
69
Seven
71
72
73
74
75
76
SevenEleven
78
79
80
81
82
83
Seven
85
86
87
Eleven
89
90
Seven
92
93
94
95
96
97
Seven
Eleven
100
101
102
103
104
Seven
106
107
108
109
Eleven
111
Seven
113
114
115
116
117
118
Seven
120
Eleven
122
123
124
125
Seven
127
128
129
130
131
Eleven
Seven
134
135
136
137
138
139
Seven
141
142
Eleven
144
145
146
Seven
148
149
150
151
152
153
SevenEleven
155
156
157
158
159
160
Seven
162
163
164
Eleven
166
167
Seven
169
170
171
172
173
174
Seven
Eleven
177
178
179
180
181
Seven
183
184
185
186
Eleven
188
Seven
190
191
192
193
194
195
Seven
197
Eleven
199
200

Sample input:_

140
4 Hop
7 Skip
5 Jump

Sample output:

1
2
3
Hop
Jump
6
Skip
Hop
9
Jump
11
Hop
13
Skip
Jump
Hop
17
18
19
HopJump
Skip
22
23
Hop
Jump
26
27
HopSkip
29
Jump
31
Hop
33
34
SkipJump
Hop
37
38
39
HopJump
41
Skip
43
Hop
Jump
46
47
Hop
Skip
Jump
51
Hop
53
54
Jump
HopSkip
57
58
59
HopJump
61
62
Skip
Hop
Jump
66
67
Hop
69
SkipJump
71
Hop
73
74
Jump
Hop
Skip
78
79
HopJump
81
82
83
HopSkip
Jump
86
87
Hop
89
Jump
Skip
Hop
93
94
Jump
Hop
97
Skip
99
HopJump
101
102
103
Hop
SkipJump
106
107
Hop
109
Jump
111
HopSkip
113
114
Jump
Hop
117
118
Skip
HopJump
121
122
123
Hop
Jump
Skip
127
Hop
129
Jump
131
Hop
Skip
134
Jump
Hop
137
138
139
HopSkipJump

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1rotary-o750.03642019/01/30 00:50:540B / 36B / 38B
2Histocrat750.03682019/02/02 01:21:510B / 34B / 41B
3clock750.03882019/02/14 02:00:340B / 36B / 38B
4krswtkhr1070.03512019/02/08 14:48:370B / 51B / 53B

Ruby2 _

RankUserSizeTimeDateStatistics
1rotary-o750.16912019/01/30 00:50:390B / 36B / 38B
2clock750.15332019/02/14 23:44:100B / 36B / 38B
3letranger790.16832019/04/28 11:43:500B / 35B / 41B

Perl _

RankUserSizeTimeDateStatistics
1llhuii560.05142019/01/31 23:40:540B / 15B / 38B
2tails560.03412019/05/22 16:09:510B / 15B / 38B
3%20590.08442019/04/05 14:15:400B / 16B / 43B
4mitchs600.03962019/01/28 22:45:030B / 15B / 41B

Python _

RankUserSizeTimeDateStatistics
1llhuii1010.09072019/02/16 14:39:270B / 53B / 45B
2mitchs1040.09172019/01/28 01:37:150B / 51B / 51B
3hallvabo1080.08962019/02/05 00:03:560B / 69B / 34B
4rolf1260.09542019/06/08 00:29:440B / 65B / 55B

Python3 _

RankUserSizeTimeDateStatistics
1llhuii970.21862019/02/16 22:02:170B / 52B / 40B
2mitchs1030.14822019/01/31 10:56:470B / 54B / 43B
3mypetlion1130.12222019/01/31 08:41:390B / 71B / 34B

PHP _

RankUserSizeTimeDateStatistics
1kevin3333g1700.18642019/05/17 15:30:110B / ?B / ?B

Lua _

RankUserSizeTimeDateStatistics
1tehtmi1170.03372019/07/14 03:03:590B / 63B / 47B
2clock1190.03342019/04/17 22:47:590B / 67B / 45B

Tcl _

RankUserSizeTimeDateStatistics
1clock1270.06882019/01/31 21:09:060B / 72B / 27B
2toomas1340.05952019/01/29 19:40:560B / 73B / 37B

C _

RankUserSizeTimeDateStatistics
1tails1170.18282019/05/22 10:50:430B / 59B / 58B
2TokusiN1460.03372019/05/21 22:53:150B / 65B / 81B

Go _

RankUserSizeTimeDateStatistics
1tyos4240.03082019/03/18 16:56:400B / ?B / ?B

AWK _

RankUserSizeTimeDateStatistics
1llhuii670.03162019/02/17 11:49:250B / 29B / 38B

Bash (builtins) _

RankUserSizeTimeDateStatistics
1tails641.03322019/06/07 15:35:450B / 28B / 31B
2llhuii660.56662019/02/17 23:05:340B / 27B / 33B

xgawk _

RankUserSizeTimeDateStatistics
1llhuii730.03832019/02/16 18:09:290B / 35B / 37B

gs2 _

RankUserSizeTimeDateStatistics
1tails170.26562019/01/28 14:54:077B / 4B / 5B
2mitchs170.25962019/02/09 03:59:197B / 6B / 4B

Scala _

RankUserSizeTimeDateStatistics
1rotary-o14210.39602019/01/27 14:21:240B / 80B / 53B

Language Ranking_

RankLangUserSizeScore
1gs2tails1710000
2Perlllhuii563035
3Bash (builtins)tails642656
4AWKllhuii672537
5xgawkllhuii732328
6Ruby2rotary-o752266
7Rubyrotary-o752266
8Python3llhuii971752
9Pythonllhuii1011683
10Ctails1171452
11Luatehtmi1171452
12Tclclock1271338
13Scalarotary-o1421197
14PHPkevin3333g1701000
15Gotyos424400

return to the top page