返回列表 發帖
  1. #include <iostream>

  2. using namespace std;

  3. int main()

  4. {
  5.   float x;
  6.   float y;
  7.   float z;
  8.    cout<<"請輸入上底"<<endl;
  9.    cin>>x;
  10.    cout<<"請輸入下底"<<endl;
  11.    cin>>y;
  12.    cout<<"請輸入高"<<endl;
  13.    cin>>z;
  14.    cout<<"您輸入的上底是"<<x<<endl;

  15.    cout<<"您輸入的下底是"<<y<<endl;

  16.    cout<<"您輸入的高是"<<z<<endl;
  17.            cout<<"("<<x<<"+"<<y<<")"<<"*"<<z<<"/2="<<(x+y)*z/2<<endl;
  18.    system("pause");

  19.    return 0;

  20. }
複製代碼

TOP

返回列表