//3-40-1:計算圓面積與周長
#include <cmath>
#include <iostream>
#define PI 3.1415926
using namespace std;
int main()
{
double r;
double p,a;
cout << " 輸入圓半徑 " << endl;
cin >> r;
p = PI * r * 2;
a = PI * r * r;
cout << " 圓周長 = " << p <<endl;
cout << " 圓面積 = " << a <<endl;
return 0;
}
|