代码如下:
#include<iostream>
using namespace std;
int main()
{
int a,b,s;
cout<<"输入三角形直角边长:"<<endl;
cin>>a>>b;
s=0.5*a*b;
cout<<"三角形面积s=" <<s<<endl;
return 0;
}
实验结果(例):
输入三角形直角边长:
3 4
三角形面积s=6
--------------------------------
Process exited after 8.234 seconds with return value 0
请按任意键继续. . .