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
Compute a dot product of two vectors x and y
Make a random, non-repeating vector.
How many trades represent all the profit?
What is Sum Of all elements of Matrix
Max of a Vector
Back to basics 25 - Valid variable names
Back to basics 5 - Clipboard
Back to basics 16 - byte order
Back to basics 12 - Input Arguments
Back to basics 23 - Triangular matrix
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