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; }
1 Respuesta
+ 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.