当前位置:网站首页>2. 输入一个圆半径r,当r>=0时,计算并输出圆的面积和周长,否则,输出提示信息。
2. 输入一个圆半径r,当r>=0时,计算并输出圆的面积和周长,否则,输出提示信息。
2022-07-22 18:12:00 【CC++Edge-淇】
#include <stdio.h>
#define PI 3.14
int main(void)
{ double r ,area , girth;
printf("please input r:\n");
scanf("%lf",&r);
if (r>=0)
{ area =PI*r*r;
girth =2*PI*r ;
printf("the area is %.2f\n", area);
printf("the girth is %.2f\n", girth);}
else
printf("Input error!\n");
return 0;
}
边栏推荐
- Use of vim editor
- 栈溢出基础练习题——3 (内有32和64位区别的对比)
- pwn栈溢出基础练习题——1
- Lc: sword finger offer 10- I. Fibonacci series
- zy:修改主机名
- 【基础8】——进程和线程
- Understanding the application steps of machine learning development
- Using "hifolw" to quickly create the information generation of College Students' return list
- PWN —— ret2libc2
- 01. Introduction to large Internet Architecture
猜你喜欢
随机推荐
Design and implementation of position recommendation system based on Knowledge Map
Zstuacm summer camp flag bearer
RAID disk array
Judge whether the map contains the specified key and value
APUE进程深层理解fork和execl-程序代码里获取虚拟机IP地址
Enter two strings STR1 and STR2, and count the number of times that the string STR2 appears in STR1.
LC:剑指 Offer 10- I. 斐波那契数列
Chapter7 循环神经网络-2
Introduction to SQL -- Basic additions, deletions, modifications, and exercises
最简单的scull设备驱动
CSDN陪伴了我四年本科生活,自己也开始好好记录一下啦
第一个PWN 栈溢出简单题
UNIX编程—网络socket
重置root密码
01. Introduction to large Internet Architecture
Apply collections Sort() implements list sorting
【基础2】——容器
User and group management
防火墙粗略了解
Information collection research report








