0

can help me in this easy proplem

hello every one I well start to make solutions for this proplem and because I dont have the pro app I can't see that all solution l will this code and I know some thing is wrong that I know get solution is wrong but I work for 2 hour and this my result the problem name in solo learn is Halloween Candy https://code.sololearn.com/cTH3eKa7JNN9/?ref=app

9th Oct 2022, 6:43 PM
Ayham Ibrahim
Ayham Ibrahim - avatar
23 Réponses
+ 3
Even Pro status does not get you answers to the hidden Code Coach answers. They are locked for everyone. To round up as required, use the ceil() rounding function. Your code already imports the cmath library where it is found. So just cout << ceil(x);
9th Oct 2022, 7:41 PM
Brian
Brian - avatar
+ 2
@Brian ok thanks but doesn't work
9th Oct 2022, 7:46 PM
Ayham Ibrahim
Ayham Ibrahim - avatar
+ 2
that's not important now ,why the ceil dosent work
9th Oct 2022, 8:02 PM
Ayham Ibrahim
Ayham Ibrahim - avatar
+ 2
Ayham Ibrahim, okay I will take back my words. The input loop is fine to leave in place, and even useful when interacting with a live person. I just think with Code Coach it is different, since the description promises to give values >=3 and it won't retry, so there is not much need to test for input range and retry. Back to the code.... the ceil function is getting called, but the return value is not saved. Try x = ceil(x).
9th Oct 2022, 8:22 PM
Brian
Brian - avatar
+ 2
Brian thanks man every things now is work and logic thanks 🖤🔥
10th Oct 2022, 3:57 AM
Ayham Ibrahim
Ayham Ibrahim - avatar
+ 2
Ayham Ibrahim Congratulations! I wish you well on your training.
10th Oct 2022, 4:29 AM
Brian
Brian - avatar
+ 2
Ayham Ibrahim did you complete it
10th Oct 2022, 4:39 PM
Sunil Shrestha
Sunil Shrestha - avatar
+ 2
Ayham Ibrahim Read question properly. Here i made some changes with comment. You should see the code once https://code.sololearn.com/cj2WIG6yDOai/?ref=app
11th Oct 2022, 12:00 PM
Sunil Shrestha
Sunil Shrestha - avatar
11th Oct 2022, 12:11 PM
Sunil Shrestha
Sunil Shrestha - avatar
+ 1
Ayham Ibrahim was there a purpose in using a while loop when taking input?
9th Oct 2022, 7:51 PM
Brian
Brian - avatar
+ 1
yes to make input more or equal three Brian
9th Oct 2022, 7:53 PM
Ayham Ibrahim
Ayham Ibrahim - avatar
+ 1
Ayham Ibrahim okay, it is doing that, but I don't understand why. The program might be more successsful if you accept any input given by Code Coach. Just get input once and use whatever value it supplies.
9th Oct 2022, 7:58 PM
Brian
Brian - avatar
+ 1
ok,what you do when user input is two or one or any number less than three ?? you should ask him more and more to but number more or equal than three.Brian
9th Oct 2022, 8:01 PM
Ayham Ibrahim
Ayham Ibrahim - avatar
11th Oct 2022, 3:58 AM
Ayham Ibrahim
Ayham Ibrahim - avatar
+ 1
Hi
11th Oct 2022, 11:20 AM
Ziyaul Haque
Ziyaul Haque - avatar
+ 1
Hey
11th Oct 2022, 11:21 AM
Sammy Chiadi
Sammy Chiadi - avatar
+ 1
11th Oct 2022, 2:03 PM
Sunil Shrestha
Sunil Shrestha - avatar
+ 1
how can i help
11th Oct 2022, 2:08 PM
Sunil Shrestha
Sunil Shrestha - avatar
+ 1
hy
15th Oct 2022, 10:47 AM
Sunil Shrestha
Sunil Shrestha - avatar
0
Sir please help me
11th Oct 2022, 2:02 PM
Shree Kumar