Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main() {
- double flourKg, flourPrice, sugarKg, eggPack, yeast;
- cin >> flourKg >> flourPrice >> sugarKg >> eggPack >> yeast;
- double flourTotal = flourKg * flourPrice;
- double sugarTotal = flourKg * sugarKg * 0.75;
- double eggPackTotal = flourKg * eggPack * 1.1;
- double yeastTotal = flourKg * 0.75 * yeast * 0.2;
- double sum = flourTotal + sugarTotal + eggPackTotal + yeastTotal;
- printf("%.2f\n", sum);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement