Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- int days;
- cin >> days;
- double availableFood, deer1, deer2, deer3;
- cin >> availableFood >> deer1 >> deer2 >> deer3;
- availableFood -= (deer1 + deer2 + deer3) * days;
- if (availableFood >= 0) {
- cout << floor(availableFood) << " kilos of food left.\n";
- }
- else {
- cout << ceil(abs(availableFood)) << " more kilos of food are needed.\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement