Documente Academic
Documente Profesional
Documente Cultură
#include <iostream>
#include <cmath>
using namespace std;
float s(float x, float y, float z)
{ float p = (x + y + z) / 2;
float s = sqrt(p * (p - x) * (p - y) * (p - z));
return s;
}
int main()
{
float a, b, c;
cout << "Introduceti lungimea laturii a :";
cin >> a;
cout << "Introduceti lungimea laturii b :";
cin >> b;
cout <<"Introduceti lungimea diagonalei :";
cin >> c;
cout << "Aria patrulaterului convex este egala cu : " << 2 * s(a, b, c) << "
cm." << endl;
return 0;
}
2.#include <iostream>
int main()
{ float a;
float b;
float c;
float d;
cin>>a;
cin>>b;
cin>>c;
cin>>d;
cout<<mmare(a,b,c, d);
cout<<mmic(a,b,c,d);
cout<<divizor3(a,b);
{
while (a - b !=0)
{
if (a > b) a -= b;
else b -= a;
}
return a;
}
float divizor2(float c,float d)
{while (c - d !=0)
{
if (c > d) c -= d;
else d -= c;
}
return c;
}
float divizor3(float a,float c)
{
while (a - c !=0)
{
if (a > c) a -= c;
else c -= a;
}
return a;
}
4.
#include <iostream>
return 0;
}
int foo1(int a)
{
for(int i=0;i<=a;i--)
{
i=i*1;
return i;
}
}
int foo2(int b)
{
for(int i=0;i<=b;i--)
{i=i*1;
return i;
}
}