Răspuns:
#include <iostream>
using namespace std;
int x,n,xcopie,suma,a;
int main()
{
cout << "X Kg="; cin >> x;
cout << "Zile="; cin >> n;
xcopie=x;
xcopie=xcopie*n;
a=1;
suma=0;
while(a<=n)
{
suma=suma+x*a;
a++;
}
cout<<endl;
cout << "Ultima zi=" << xcopie << "kg."<<endl;
cout << "Total=" << suma << "kg"<<endl;
cout << suma/3000 + 1 << "curse"<<endl;
return 0;
}
Explicație: