Răspuns:
#include <iostream>
using namespace std;
int main()
{
int g ,i ,p, total;
cout << "Nr gaini!" << endl;
cin >> g;
cout << "Iepuri:"<< endl;
i = g * 3;
cout << i <<endl;
cout << "Pui:" << endl;
p = 2 * (i + g);
cout << p <<endl;
total = g + i + p;
cout << "Sunt " << total << " de animale in total"<<endl;
cout <<"Sunt " <<g <<" gaini ," << i <<" iepuri ,"<<p <<" si pui"<<endl;
return 0;
}
Explicație: