Advertisement
Spocoman

Cat Diet

Sep 15th, 2023
820
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     double fats, proteins, carbohydrates, calories, water;
  8.     cin >> fats >> proteins >> carbohydrates >> calories >> water;
  9.  
  10.     double caloriesPerGram = (100 - water) * (calories / (calories * fats / 9
  11.         + calories * proteins / 4 + calories * carbohydrates / 4));
  12.  
  13.     printf("%.4f\n", caloriesPerGram);
  14.  
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement