Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
HALLOWEEN CANDY
Kindly check the Halloween candy Problem and my Solution to it. It passed only 2 test cases and failed the other 3. Please help me to improve my code so that it passes all 5 test cases https://sololearn.com/coach/4/?ref=app https://code.sololearn.com/cjp2sfvJIoE4/?ref=app
3 Respostas
+ 3
Try it in this way
#include <iostream>
using namespace std;
int main()
{
float houses;
float dollar;
cin >> houses;
//your code goes here
{
dollar = (((houses - (houses - 2))) / houses) * 100;
if (dollar == (int)dollar) {
cout << dollar;
}
else
cout << (int)dollar + 1;
}
return 0;
}
+ 3
Most welcome SNEHEL
+ 1
thanx it worked!