- #include <iostream>
- using namespace std;
- int main()
- {
- float x, y;
- cout<<"enter the base of the triangle(cm):";
- cin>>x;
- cout<<"enter the height of the triangle(cm):";
- cin>>y;
- cout<<"The base is "<<x<<"cm, the height is "<<y<<"cm; therefore, the surface area will be "<<x*y/2<<"square centimeters."<<endl;
- system("pause");
- return 0;
- }
複製代碼 |