0
9.2 code coach C++
Having trouble solving all test cases at once, I can solve for each test case individually but can’t pull them all off. What am I missing? Should I add an if statement or something. For example I will solve the first part to get an output of 8. How to I get the other outputs as well? I’m a newbie so bare with me lol.
10 odpowiedzi
+ 3
A common mistake is to hard code the input values. Remove the hard-coded assignment to crabs. Code Coach will supply the input values through console input when you run the tests.
+ 1
Post your question please
0
Show your code
0
As well as the question too
0
#include <iostream>
using namespace std;
int main() {
int crabs;
int dish;
cin >> crabs;
crabs= 25;
dish= crabs/3;
cout<<dish<<endl;
return 0;
}
0
This is what do to fulfill the first part but the other 2....im stumped.
0
How do I properly code all 3 of the test cases at once? I only complete the first one properly.
0
Can someone show me some code of how it should look?
0
Ahh ok