返回列表 發帖
本帖最後由 蔡昀佑 於 2011-9-17 16:32 編輯

#include <iostream>

using namespace std;

int main()

{
    float x,y,z;
    cout<<"請輸入上底(公分)"<<endl;

    cin>>x;

    cout<<"請輸入下底(公分)"<<endl;
   
    cin>>y;
   
    cout<<"請輸入高(公分)"<<endl;
   
    cin>>z;
   
    cout<<"梯形面積為"<<x+y*z/2<<"平方公分"<<endl;
     
system("pause");

  return 0;   

}

TOP

返回列表