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


  4. int main(){
  5.    
  6.    
  7.    
  8.     float x;   
  9.     float y;   
  10.    
  11.     cout<<"請輸入矩形的長:";
  12.     cin>>x;
  13.     cout<<"請輸入矩形的寬:";
  14.     cin>>y;
  15.    
  16.     cout<<"長為:"<<x<<"、寬為:"<<y<<"的矩形,面積為:"<<x*y<<",周長為:"<<(x+y)*2<<endl;
  17.    
  18.     system("pause");        
  19.     return 0;               
  20. }
複製代碼

TOP

返回列表