#include<cstdio> using namespace std; #define PI 3.14159//定义PI int main(){ double r;//半径 scanf("%lf",&r); printf("A=%.4lf",PI*r*r); return 0; } /**注意事项: * 1、如果r使用float定义,会出现精度丢失问题 * 2、#define PI 3.14159时末尾没有分号 */