0

Help!!! C++

https://www.sololearn.com/coach/4?ref=app Please, tell why my code doesn't pass all the tests. #include <iostream> #include <math.h> using namespace std; int main() { int houses; cin>>houses; //your code goes here double bills = 2; double chance = (bills / (double)houses) * 100; if(houses % 3 == 0){ cout << round(chance) << endl; } else { cout << round(chance) << endl; } return 0; }

23rd Jan 2020, 7:09 PM
Влад Даниленко
Влад Даниленко - avatar
1 Resposta
+ 2
Влад Даниленко did you read the information closely... I know it is easy to look at the problem but overlook solutions Task Given the input of the total number of houses that you visited, what is the percentage chance that one random item pulled from your bag is a dollar bill? Input Format An integer (>=3) representing the total number of houses that you visited.
23rd Jan 2020, 7:22 PM
BroFar
BroFar - avatar