python编程求圆的周长和面积公式_C语言求圆的周长和面积

#include

#define T 3.141592654

double Syuan(float r)

{

double s=T*r*r;//s

位圆的面积

此刻

s=T*r*r

有效超出

7

位了所以用

double

return s;

}

double Cyuan(float r)

{

double c=2*T*r;//c

为圆的周长

此刻

c=2*T*r

有效超出

7

位了所以用

double

return c;

}

void main()

{

float r;

printf("please input the r of a circle:");

scanf("%f",&r);

printf("the circle's square is:% .8f\n",Syuan(r));

printf("the circle's circumference is:% 6.2f\n",Cyuan(r));//%6.2f

整数部分保留

6

位,

数部分保留

2

位,并四舍五入

}

//

类型

比特数

有效数字

数值范围

//

float

32

6-7

-3.4*10(-38)

3.4*10(38)

//

double

64

15-16

-1.7*10(-308)

1.7*10(308)

//

long double

128

18-19

-1.2*10(-4932)

1.2*10(4932)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值