Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- double food, hay,cover, weight;
- cin >> food >> hay >> cover >> weight;
- for (int i = 1; i <= 30; i++) {
- food -= 0.3;
- if (i % 2 == 0) {
- hay -= food * 0.05;
- }
- if (i % 3 == 0) {
- cover -= weight / 3;
- }
- }
- if (food < 0 || hay < 0 || cover < 0) {
- cout << "Merry must go to the pet store!" << endl;
- }
- else {
- printf("Everything is fine! Puppy is happy! Food: %.2f, Hay: %.2f, Cover: %.2f.", food, hay, cover);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement