返回列表 發帖
  1. # include <iostream>
  2. # include <cstdlib>
  3. using namespace std;

  4. int main (){
  5.     float x,y;
  6.     cout<<"請輸入矩形的長:";
  7.     cin>>x;
  8.     cout<<"請輸入矩形的寬:";
  9.     cin>>y;
  10.     cout<<"長:"<<x<<"cm, 寬:"<<y<<"cm,"<<"周長為:"<<(x+y)*2<<"cm, 面積為:"<<x*y<<endl;
  11.     cout<<"感謝使用此計算機!"<<endl;
  12.     system ("pause");
  13.     return 0;
  14. }
複製代碼

TOP

返回列表