#include <stdio.h> #include <math.h> int f() { float p,s; int a,b,c; scanf("%d %d %d",&a,&b,&c); p=(a+b+c)/2.0; s=sqrt(p*(p-a)*(p-b)*(p-c)); printf("%.2f",s); } int main() { int t; //printf("总共几组数据:\n"); scanf("%d",&t); while(t>0) { f(); t--; } } |
Double click to view unformatted code.