Răspuns :
Răspuns:
#include <iostream>
#include <cmath>
using namespace std;
double ariaDrept(int a,int b)
{
//aria drept. = a * b
return a * b;
}
double ariaSq(int a)
{
//aria patr. = a^2
return a * a;
}
void checkTr(int a,int b,int c)
{
if(a==b && b==c && c==a)
{
cout<<"Triunghi Echilateral\n";
}
else if(a==b || b==c || c==a)
{
cout<<"Triunghi isoscel\n";
}
else if(a*a==b*b+c*c ||b*b==c*c+a*a || c*c==a*a+b*b)
{
cout<<"Triunghi Dreptunghic\n";
}
else
{
cout<<"Triunghi Scalene/Oarecare\n";
}
}
int main()
{
//Laturile a b c
//nr random de la 1 la 25
int a = rand() % 24 + 1;
int b = rand() % 24 + 1;
int c = rand() % 24 + 1;
cout << a << endl << b << endl<< c << endl;
cout << "Parchet: " << ariaDrept(a,b) << " m^2" << endl;
cout << "Pavele: " << ariaSq(a) << " m^2" << endl;
checkTr(a,b,c);
}
L-am compilat pe onlinegdb