Răspuns:
1.#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int x;
float s;
cin>>x;
if(x<=1)
s=sqrt(pow(x,1)+1);
else
s=(pow(x,3)-3)*1.0/(x-1);
cout<<s;
}
2.#include <iostream>
using namespace std;
int main()
{
int b,B,h;
cin>>b>>B>>h;
cout<<((b+B)*h)/2;
}
3.#include <iostream>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
cout<<(a+b+c)*1.0/3;
}
4.#include <iostream>
using namespace std;
int main()
{
int n,i,j;
cin>>n;
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
cout<<2*j-1<<" ";
cout<<endl;
}
}
5.#include <iostream>
using namespace std;
int main()
{
float a,b,c,delta;
cin>>a>>b>>c;
delta=b*b-4*a*c;
if(delta<0)
cout<<"Ecuatia nu are solutii";
else
cout<<(-b-delta)/(2*a)<<" "<<(-b+delta)/(2*a);
}
Explicație: