Rate my code Sup Forums :^)
Rate my code Sup Forums :^)
it's shit
Why?
>bottles and i are separate variables
Once you've fixed that, now make it start at a given value (instead of 99).
I don't understand what your program does, what are you trying to achieve here?
That's not how the song goes
kinda goofy
How's this?
By looking at whatever he's printing out, it's just the "99 Bottles of Beer" song.
Also yeah OP, is right, who the hell "shuffles around" bottles of beer?
IT "PASS IT AROUND"YOU FUCKING MEMER
if() {
}
//not
if()
{
}
cia nigger
I was just trying to add a little personal spice to my script
>using namespace std;
>std::cout
good one.
>i=i
Just leave that part empty.
for(; i > 0; --i)
Why?
wont start each verse on an odd number? so you're skipping the even verses.
pajeet/10
Also, you don't need that s variable, just use a ternary operator.
(i == 1 ? "" : "s")
what the fuck is this autistic poem?
you are saying "I'm using the namespace std" so you don't have to write std::blah_di_blah, but you are writing it anyway. You just need cout with no std::
Also, that's fairly bad practice, to use a blanket "using namespace ...." statement, it defeats the entire purpose of having namespaces. If you want to know why, just ask.
If the spice was homosexuality, ya fucking nailed it faggot.
Don't fuck with road trip songs, that's how you die.
Sorry, I learned from learncpp.com :^)
>using namespace std;
>std::cout
>std::
>bottles -= 1;
>not just using bottles--;
>using strings for single char
>using string library at all
>having separate ints for bottles and counting even though they are the same value
>wasting three lines on curly brackets even though conditions contain a single statement
>using iostream library when simply printf would suffice
>not learncp.com
This is how bloatware is made, right?
What's the difference between --i and i--?
>no space on both sides of "
no worries, we all start somewhere. just keep working. You know how to compile successfully, yes?
Prefix and postfix
It makes no difference in a for loop but necessary if your using it in conditionals or functions. A prefix subtracts before checking and a postfix checks and then subtracts. Consider it an order of operations
i--; // take the value of i then decrement
--i; // decrement i then take the value
I guess? I started by using codeblocks in Windows (shut up, I know, visual studio is too big of a download), but for this little loop I was just using nano and g++ via a Linux terminal because I thought it'd be fun.
I hope the markdown works.
I'm drunk, but I modified the code a bit, it probably sucks.
```c++
#include
#include
using std::cout;
using std::string;
int main() {
string bottles = " bottles";
for (int i = 99; i > 0; i--) {
cout
why do people even use cout?
it's so ugly and messy
is there something wrong with printf?
Python fag detected
>old shit langs
cout
You are literally retarded. Kill yourself, you dumb fucking shit stain.
no u
You deserve to be buried alive in a box full of spiders, you fucking subhuman sack of shit. Your mother should be stoned to death for not having you aborted, you worthless shit stain.
Get raped and kill yourself you retarded fucking faggot sack of nigger shit with down syndrome.
code tags bro (bb style)
Both are shit. cout for overloading the bitwise shift and causing a large trend to change that operator into a stream operator, and printf for having to parse format strings.
God I hate how I work in c and c++ every day
The one and only way to do bottles of beer.
(I am not serious)
>shuffle it around
THAT'S NOT HOW IT GOES RREEEEEEE
senior cs/10
wtf, one of the worst code samples I've seen... why not s = (bottles == 1) ? "" : "s"
Made an attempt as well ^^
Weird code style.
learncpp.com tells you to not use the namespace for no reason...
>using std:: when he declared namespace std
poop/shit
>using the smiley with a carat nose
Thanks for making me want to kill myself
no u