返回列表 發帖
本帖最後由 t8155745 於 2011-9-17 16:31 編輯
  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/2<<endl;
  13.    
  14.    
  15.    
  16.    
  17.    
  18.    
  19.    
  20.    
  21.    
  22. system("pause");
  23.   return 0;   
  24. }
複製代碼

TOP

返回列表