返回列表 發帖
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     float x, y,z;
  6.     cout<<"請輸入梯形的上底(公分): "<<endl;;
  7.     cin>>x;
  8.     cout<<"請輸入梯形的下底(公分): "<<endl;
  9.     cin>>y;
  10.     cout<<"請輸入梯形的高(公分): "<<endl;
  11.     cin>>z;
  12.     cout<<"上底為"<<x<<"公分的梯形,下底為"<<y<<"公分的梯形,高為"<<z<<"公分,面積為"
  13.     <<(x+y)*z/2<<"平方公分"<<endl;
  14.     system("pause");
  15.     return 0;   
  16. }
複製代碼

TOP

返回列表