返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main ()
  5. {
  6.     int w;
  7.         int h;
  8.        
  9.         cout<<"請輸入矩形的高(公分):";
  10.         cin>>w;
  11.     cout<<"請入矩形的寬(公分):";
  12.     cin>>h;
  13.         cout<<"====================="<<endl;
  14.        
  15.         cout<<"這個矩形的周長是 "<<(w+h)*2<<endl;
  16.         cout<<"這個矩形的面積是 "<<w*h<<endl;
  17.        
  18.         system("pause");
  19.         return 0;
  20. }
複製代碼

TOP

返回列表