题目内容:
编程并输出半径r=5.3的半圆弧长(提示:半圆弧长不应该加直径的长度。)及该半圆弧与直经围成的半圆的面积,π的取值为3.14159。要求半径r和π必须利用宏常量表示。
输入格式:无
输出格式:
半圆的面积输出格式: "Area=%.5f\n"
半圆弧长输出格式: "circumference=%.5f\n"
输出样例:
Area=44.12363
circumference=16.65043
#include <stdio.h>
#define PI 3.14159
#define R 5.3
int main()
{
printf("Area=%.5f\n",PI*R*R/2);
printf("circumference=%.5f\n",PI*R);
return 0;
}