What seems to be the issue here 🤔, #hidden (locked) testcases in Fruitbowl | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What seems to be the issue here 🤔, #hidden (locked) testcases in Fruitbowl

The hidden test cases are the ones that won't allow this fruit = int(input()) if(fruit>=0): if(fruit%2==0): apple=fruit//2 print(apple//3)

7th Oct 2021, 2:50 AM
N J
3 Answers
+ 1
Yes question have to be changed(it said only even inputs)but ,it gives odd inputs also.(A MISTAKE) you can confirm by place != operator instead of == operator you will find hidden test cases pass and 1 and 2 will fail. so input can be anything odd or even , so don't check for only even inputs
7th Oct 2021, 4:26 AM
Prabhas Koya
0
Hi N J! It gives no output for positive odd numbers because of your second if statement. For that, you can remove that statement or comment it. So, your code needs to be like this fruit = int(input()) if(fruit>=0): #if(fruit%2==0): apple=fruit//2 print(apple//3)
7th Oct 2021, 4:07 AM
Python Learner
Python Learner - avatar
0
include <iostream> using namespace std; int main() { int fruit; cin>>fruit; int pie; for (int i=0; i<= fruit/2; i+=3){ if (i ==0){ continue ; } pie++; } cout << pie; return 0; }
31st Jan 2024, 11:34 PM
tipakon85 Pr1nX
tipakon85 Pr1nX - avatar