返回列表 發帖

[隨堂測驗] 面積計算 (二) - 圓面積

圓面積的計算公式如下:
圓面積 = 半徑 x 半徑 x 3.14

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     float a;
  7.     cout<<"請輸入圓形的半徑:";
  8.     cin>>a;
  9.     cout<<"半徑:"<<a<<"公分的圓形,面積為"<<a*a*3.14<<"平方公分。"<<endl;
  10.     system("pause");
  11.     return 0;
  12. }
複製代碼
附件: 您需要登錄才可以下載或查看附件。沒有帳號?註冊

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    float x;
  7.    
  8.     cout<<"請輸入圓形的半徑(公分):" ;
  9.     cin>>x;
  10.    
  11.     cout<<"半徑"<< x <<"公分的圓形,面積為"<<x*x*3.14<<"平方公分"<<endl;
  12.    
  13.    
  14.     system("pause");
  15.     return 0;
  16.    
  17.    
  18. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;

  4. int main()
  5. {   
  6.     float x;
  7.     cout<<"請輸入圓(公分)";
  8.     cin>>x;
  9.     cout<<"半徑:"<<x<<"公分的三角形面積為"<<x*x*3.14<<"平方公分";
  10.    
  11.     system("pause");
  12.     return 0;
  13. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     float a;
  7.     cout<<"請輸入圓的半徑(公分):"<<endl;
  8.     cin>>a;
  9.     cout<<"半徑:"<<a<<"公分的圓面積為"<<a*a*3.14<<"平方公分"<<endl;                                 
  10.     system("pause");
  11.     return 0;
  12. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     float a;
  7.     cout<<"請輸入三角形的直徑(公分)"<<endl;
  8.     cin>>a;
  9.     cout<<"圓形的直徑為"<<a<<"公分,是"<<a*a*3.14/2<<"平方公分。"<<endl;
  10.     system("pause");
  11.     return 0;
  12. }
複製代碼

TOP

#inciude<iostream>
#inciude<cstdlib>
using namespace std;
int main()
{
    float a;
    cout<<"請輸入圓的半徑:"<<endl;
    cin>>a;
   
    cout<<"半徑"<<a<<"公分的圓,面積為"<<a*a*3.14<<"平方公分"<<endl;
    system("pause");
    return 0;
    }

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     float a;
  7.     cout<<"請輸入三角形的直徑(公分)"<<endl;
  8.     cin>>a;
  9.     cout<<"圓形的直徑為"<<a<<"公分,是"<<a*a*3.14/2<<"平方公分。"<<endl;
  10.     system("pause");
  11.     return 0;
  12. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;

  4. int main()
  5. {
  6.    float a;
  7.     cout<<"請輸入圓的半徑(公分):"<<endl;
  8.     cin>>a;
  9.     cout<<"半徑:"<<a<<"公分的圓,面積為"<<a*a*3.14<<"平方公分"<<endl;
  10.     system("pause");
  11.     return 0;
  12. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     float a;
  7.     cout<<"請輸入三角形的直徑(公分)"<<endl;
  8.     cin>>a;
  9.     cout<<"圓形的直徑為"<<a<<"公分,是"<<a*a*3.14/2<<"平方公分。"<<endl;
  10.     system("pause");
  11.     return 0;
  12. }
複製代碼
林祐霆

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;

  4. int main()
  5. {
  6.     float x;
  7.     cout<<"請輸入圓形的半徑(公分):"<<endl;
  8.     cin>>x;
  9.     cout<<"半徑:"<<x<<"公分的圓,面積為"<<x*x*3.14<<"平方公分"<<endl;
  10.     system("pause");
  11.     return 0;
  12. }
複製代碼

TOP

返回列表