Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- double fats, proteins, carbohydrates, calories, water;
- cin >> fats >> proteins >> carbohydrates >> calories >> water;
- double caloriesPerGram = (100 - water) * (calories / (calories * fats / 9
- + calories * proteins / 4 + calories * carbohydrates / 4));
- printf("%.4f\n", caloriesPerGram);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement