Problem: Given a real number in exactly two digits after the decimal point, and another integer. Print their product, rounded down to the nearest integer.
You may start to code this way:
double a; int b; cin >> a >> b; int c = a * b; cout << c << endl;
Do you think this is correct? Well, almost. Now, try this input:
What will the output be? [Read more…]