1、正确进入VC++,设置字体,字体的大小。调整到舒适的环境:
2、编写程序:
#include <stdio.h>
#include <math.h>
void main()
{
float a,b,c,s,p;
printf("请输入三角形的三边长: ");
scanf("%f,%f,%f",&a,&b,&c);
p=(a+b+c)/2;
s=sqrt(p*(p-a)*(p-b)*(p-c));
printf("三角形面积=%6.2f\n",s);
}

3、点击“编译”,“连接”,“运行”,输入边长为3,4,5:
