#include <stdio.h> #include <math.h> int main(){ int a,b,c; double area=0,perimeter=0; double s; if (scanf("%d",&a)!=EOF && scanf("%d",&b)!=EOF && scanf("%d",&c)!=EOF && (a+b)>c && (a+c)>b && (b+c)>a){ // 计算最大的5分钱个数 s = (a+b+c)/2.0; area = sqrt(s*(s-a)*(s-b)*(s-c)); perimeter = a+b+c; printf("area = %.2f; perimeter = %.2f",area,perimeter); }else{ printf("These sides do not correspond to a valid triangle"); } return 0; }