Was the Campaign Worth It?
Lantern's marketing lead has to defend a campaign to a finance committee that asks only one question: for every unit spent, what came back on top of the spend? The revenue figure alone never settles it — a campaign that made money and one that quietly burned it can both show an impressive-looking total.
Task: Print the campaign's return on investment, as a percentage.
Input
Two lines. The first holds what the campaign cost, never zero. The second holds the revenue it brought in. Either may be whole or decimal.
Output
One line: a percentage with exactly one digit after the decimal point. Only what came back beyond the cost counts as return, and it is measured against the cost. A campaign that lost money prints negative; one that exactly washed its face prints 0.0.
Example:
Input:
2000
5000
Output:
150.0
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in