- 1
Why this answer isn't ok? Training coding
Can someone tell me what's wrong? #include <iostream> #include <cmath> using namespace std; int main() { int houses; cin>>houses; //your code goes here double var; var = (2.0 / houses) * 100; double percent; percent = round(var); cout << percent; return 0; }
2 odpowiedzi
+ 6
percent = ceil(var);
https://www.sololearn.com/Discuss/2751150/?ref=app
0
Test just is:
"You go trick or treating with a friend and all but three of the houses that you visit are giving out candy. One house that you visit is giving out toothbrushes and two houses are giving out dollar bills.
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.
Output Format
A percentage value rounded up to the nearest whole number."