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.
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... ;-)
It is weird that I've been wrong for twice.
This user (mohamed elbesealy) appears to have gamed the system, with fraudulent "likes" of this unremarkable solution submitted by 'sock-puppet' accounts. —DIV
what is the problem in my solution? why it is showing error.
output is named 'remaining' and not 'y'
Did I miss the twist?
D: What the ...
Hooray BEER! :D
Given a window, how many subsets of a vector sum positive
Set the array elements whose value is 13 to 0
07 - Common functions and indexing 6
Deleting an element in a matrix
Replacing a row
Back to basics 24 - Symbolic variables
Back to basics 3 - Temp Directory
Back to basics 25 - Valid variable names
Back to basics 26 - Keywords
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office