#include <stdio.h> int main() { int a, b, c; //创建边长 scanf("%d %d %d", &a, &b, &c); float circumference; float area; int d, e, f; d = a + b; e = b + c; e = a + c; if(a, b, c > 0 && a, b, c < 100000) //题目中的限制条件 { //满足三角形的形成条件,任意两边之和大于第三边 if(d > c && e > a && e > b) { //计算周长 circumference = a + b + c; //计算面积,利用海伦公式,sqrt为根号,即开平方 float p = circumference / 2; area = sqrt(p * (p - a)*(p - b)*(p - c)); } } printf("circumference=%.2f area=%.2f", circumference, area); return 0; }