//Calculation of sides and perimeter of triangle
#include <stdio.h>
#include <math.h>
int main(void){
double xA, yA, xB, yB, xC, yC, AB, BC, AC, p;
printf("Coordinates of point A:\n"); scanf("%lf %lf", &xA
, &yA
); printf("Coordinates of point B:\n"); scanf("%lf %lf", &xB
, &yB
); printf("Coordinates of point C:\n"); scanf("%lf %lf", &xC
, &yC
); AB
= sqrt((xA
- xB
) * (xA
- xB
) + (yA
- yB
) * (yA
- yB
)); BC
= sqrt((xB
- xC
) * (xB
- xC
) + (yB
- yC
) * (yB
- yC
)); AC
= sqrt((xA
- xC
) * (xA
- xC
) + (yA
- yC
) * (yA
- yC
)); p = AB + BC + AC;
return 0;
}
Ly9DYWxjdWxhdGlvbiBvZiBzaWRlcyBhbmQgcGVyaW1ldGVyIG9mIHRyaWFuZ2xlCiNpbmNsdWRlIDxzdGRpby5oPgojaW5jbHVkZSA8bWF0aC5oPgoKaW50IG1haW4odm9pZCl7Cglkb3VibGUgeEEsIHlBLCB4QiwgeUIsIHhDLCB5QywgQUIsIEJDLCBBQywgcDsKCXByaW50ZigiQ29vcmRpbmF0ZXMgb2YgcG9pbnQgQTpcbiIpOwoJc2NhbmYoIiVsZiAlbGYiLCAmeEEsICZ5QSk7CglwcmludGYoIkNvb3JkaW5hdGVzIG9mIHBvaW50IEI6XG4iKTsKCXNjYW5mKCIlbGYgJWxmIiwgJnhCLCAmeUIpOwoJcHJpbnRmKCJDb29yZGluYXRlcyBvZiBwb2ludCBDOlxuIik7CglzY2FuZigiJWxmICVsZiIsICZ4QywgJnlDKTsKCUFCID0gc3FydCgoeEEgLSB4QikgKiAoeEEgLSB4QikgKyAoeUEgLSB5QikgKiAoeUEgLSB5QikpOwoJQkMgPSBzcXJ0KCh4QiAtIHhDKSAqICh4QiAtIHhDKSArICh5QiAtIHlDKSAqICh5QiAtIHlDKSk7CglBQyA9IHNxcnQoKHhBIC0geEMpICogKHhBIC0geEMpICsgKHlBIC0geUMpICogKHlBIC0geUMpKTsKCXAgPSBBQiArIEJDICsgQUM7CglwcmludGYoIkFCPSU4bGdcbiIsIEFCKTsKCXByaW50ZigiQkM9JThsZ1xuIiwgQkMpOwkKCXByaW50ZigiQUM9JThsZ1xuIiwgQUMpOwkKCXByaW50ZigicCA9JThsZ1xuIiwgcCk7CglyZXR1cm4gMDsKfQ==