0
Halloween candy help C++
Can someone help with the Halloween candy i tried everything but nothing works i ended up all the ideas.
6 Réponses
+ 1
* in the task description it says we're to ROUND UP
* output the result
+ 2
Please link your code attempt, so we can help you with it!
0
#include <iostream>
using namespace std;
int main() {
int houses;
float percentage;
cin>>houses;
//your code goes here
percentage=round((100*2)/houses);
return 0;
}
0
Ohhhh
0
Here is the code try this one
double result;
result = (2.00 / houses)*100;
if (result >200/houses)
cout<<(200/houses)+1;
else
cout << result ;
0
#include <iostream>
using namespace std;
int main() {
int houses;
cin>>houses;
//your code goes here
float toFloat(houses) ;
float chance((100/toFloat)*2+.99) ;
int out(chance) ;
cout << out;
return 0;
}
https://code.sololearn.ucom/cv89oPEObLO4/?ref=app