1. #include <iostream>
//numele tau
using namespace std;
int main()
{
int a, b ,A, P;
cin>>a>>b;
A=a*b;
P=2*a+2*b;
cout<<"A="<<A;
cout<<"P="<<P;
return 0;
}
2 si 3 sunt la fel, deci eu am folosit acelasi program:
#include <iostream>
//numele tau
using namespace std;
int main()
{
int x, s=0;
cin>>x;
while(x!=0)
{s=s+x%10;
x=x/10;}
cout<<"Suma numerelor este"<<s;
return 0;
}
4. #include <iostream>
//numele tau
using namespace std;
int main()
{double v, d=60;
cin>>v;
if(v<0)
{cout<<"V trebuie sa fie pozitiva. Introdu :";
cin>>v;}
double timp=d/v;
cout<<"Trenus ajunge in Bucuresti in"<<timp*60<<"minute.";
return0;
}
Poti sa dai copy paste la fiecare exercitiu in parte :)