Problem 304. Bottles of beer
Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and pass it around.
Solution Stats
Problem Comments
-
10 Comments
The correct answer should be always 0, :)
If zero is the number that's input into the function, you end up with -1 bottles of beer on the wall?
Negative beer amounts? Oh dear
Negative amounts of beer? Means you are drunk then:)
Do you seriously require a matlab program to solve this?:/
Problem worth solving.
Beer all the way..Cheers..!!
could be a bit more challenging...
For instance, why don't calculate the statistic probabillity how many beer is drunk by male & female party people during one night. With exponential increasing amount of drunken beer in the later hours... ;-)
Easy!
good
Simply fun.
Solution Comments
Show commentsProblem Recent Solvers2195
Suggested Problems
-
102159 Solvers
-
Replace NaNs with the number that appears to its left in the row.
3008 Solvers
-
474 Solvers
-
Back to basics 4 - Search Path
367 Solvers
-
Set the array elements whose value is 13 to 0
1373 Solvers
More from this Author39
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!