Does anyone have a C program that solves the Cigarette Smoker's problem? I would like to see how the problem is worked out. If anyone would be able to post the coding, would be much appreciated. Thanks.
Does anyone have a C program that solves the Cigarette Smoker's problem? I would like to see how the problem is worked out. If anyone would be able to post the coding, would be much appreciated. Thanks.
Yeah, right
Straight from the board to your tutor no doubt
Does anyone have a C program that solves the Cigarette Smoker's problem?
Are you kidding? The problem is that these smokers don't realize how bad the habit really is! Surely you know that these things take determination and self-control? I'm afraid no program can do this for you. It is similar to students that refuse to do their own homework - addicted to the idea that someone might write their code for them - denying the truth that others cannot help those that cannot help themselves....
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
Nice one Sebastiani
thanks
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
Well........... I was bored...Code:#include <life.h> #include <stdinhale.h> #include <cancer.h> #include <badsmells.h> int main(void) { struct life mylife; CreateNewLife(&mylife); // And we all know what that function does ;-)) while (mylife.Alive) { LiveAYear(&mylife); if (mylife.age > 13 && mylife.peer_pressure > 50) mylife.smoker = TRUE; if (mylife.smoker) SmokeLots(&mylife); if (mylife.Cancer == TRUE) mylife.Alive = FALSE; if (RandomDeath(&mylife)) mylife.Alive = FALSE; } if (mylife.smoker) return (EXIT_FAILURE); else return (EXIT_SUCCESS); }
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
>>#include <stdinhale.h>
HAHAHA! That's my favorite part! Good play on words, Hammer.