+ 1

[SOLVED] If someone could help find whats wrong with this program.Itworks fine outside sololearn.But not in the playground

https://code.sololearn.com/c35DBQr0qFoS/?ref=app

24th Nov 2017, 6:32 AM
Just A Learner
Just A Learner - avatar
4 ответов
+ 3
I will post the solution here for anyone that comes across the same problem. pow(5,3) or 5,2 will take and make them floats and do the math so for 5,2 you get 24.99999 and then it makes it a int dropping the .9999 and making it 24 or in our case 124. So you need to do (pow(rem,count)+0.5); that will round it up.
24th Nov 2017, 7:25 AM
Mooaholic
Mooaholic - avatar
+ 7
Please follow the @Mooaholic's advice and let us all know here if that helped. An interesting case, I must say...
24th Nov 2017, 6:52 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 3
I solved it 😁 redemption!!!!
24th Nov 2017, 6:50 AM
Mooaholic
Mooaholic - avatar
+ 2
okay... so it's working now that I added 0.5 to pow(rem,count).... thanks @Mooaholic 😊 you guys can check the code now.... https://code.sololearn.com/c35DBQr0qFoS/?ref=app
24th Nov 2017, 7:27 AM
Just A Learner
Just A Learner - avatar