那用c语言编写一个程序从键盘输入圆的半径计算该圆的周长面积。并输出

2025-03-01 00:06:09
推荐回答(1个)
回答1:

#include
#define
pai
3.1415926;
void
main()
{
int
r;
scanf("%d",&r);
int
c
=
2*r*pai;
int
s
=
r*r*pai;
printf("周长为:%d,面积为:%d",c,s);
}
因为方便,我就把r,c,s定义为int类型了,你可以根据你的需要修改类型