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
So many choices
How many trades represent all the profit?
Is the input divisible by 3?
07 - Common functions and indexing 4
Is this triangle right-angled?
Convert Roman to Arabic Numerals
Back to basics 1 - Saving
Back to basics 19 - character types
Convert Hard Drive marketing sizes to actual data sizes
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