#include <iostream>
#include <cmath> // Per la funzione sqrt()
using namespace std;
int main( ) {
float base, altezza, diagonale, area, perimetro;
// Input dei dati
cout << "Inserisci la base del triangolo: " ;
cin >> base;
cout << "Inserisci l'altezza del triangolo: " ;
cin >> altezza;
// Calcoli
area = ( base * altezza) / 2 ;
diagonale = sqrt ( pow ( base, 2 ) + pow ( altezza, 2 ) ) ; // Teorema di Pitagora
perimetro = base + altezza + diagonale;
// Output dei risultati
cout << "Area del triangolo: " << area << endl;
cout << "Diagonale del triangolo: " << diagonale << endl;
cout << "Perimetro del triangolo: " << perimetro << endl;
return 0 ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+ICAvLyBQZXIgbGEgZnVuemlvbmUgc3FydCgpCgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICBmbG9hdCBiYXNlLCBhbHRlenphLCBkaWFnb25hbGUsIGFyZWEsIHBlcmltZXRybzsKCiAgICAvLyBJbnB1dCBkZWkgZGF0aQogICAgY291dCA8PCAiSW5zZXJpc2NpIGxhIGJhc2UgZGVsIHRyaWFuZ29sbzogIjsKICAgIGNpbiA+PiBiYXNlOwogICAgY291dCA8PCAiSW5zZXJpc2NpIGwnYWx0ZXp6YSBkZWwgdHJpYW5nb2xvOiAiOwogICAgY2luID4+IGFsdGV6emE7CgogICAgLy8gQ2FsY29saQogICAgYXJlYSA9IChiYXNlICogYWx0ZXp6YSkgLyAyOwogICAgZGlhZ29uYWxlID0gc3FydChwb3coYmFzZSwgMikgKyBwb3coYWx0ZXp6YSwgMikpOyAgLy8gVGVvcmVtYSBkaSBQaXRhZ29yYQogICAgcGVyaW1ldHJvID0gYmFzZSArIGFsdGV6emEgKyBkaWFnb25hbGU7CgogICAgLy8gT3V0cHV0IGRlaSByaXN1bHRhdGkKICAgIGNvdXQgPDwgIkFyZWEgZGVsIHRyaWFuZ29sbzogIiA8PCBhcmVhIDw8IGVuZGw7CiAgICBjb3V0IDw8ICJEaWFnb25hbGUgZGVsIHRyaWFuZ29sbzogIiA8PCBkaWFnb25hbGUgPDwgZW5kbDsKICAgIGNvdXQgPDwgIlBlcmltZXRybyBkZWwgdHJpYW5nb2xvOiAiIDw8IHBlcmltZXRybyA8PCBlbmRsOwoKICAgIHJldHVybiAwOwp9