当前位置:网站首页>NOI OJ 1.3 09:与圆相关的计算 C语言
NOI OJ 1.3 09:与圆相关的计算 C语言
2022-06-23 10:12:00 【chd44】
描述
给出圆的半径,求圆的直径、周长和面积。
输入
输入包含一个实数r(0 < r <= 10,000),表示圆的半径。
输出
输出一行,包含三个数,分别表示圆的直径、周长、面积,数与数之间以一个空格分开,每个数保留小数点后4位。
#include<stdio.h>
int main(){
double r,pi=3.14159;
scanf("%lf",&r);
printf("%.4lf %.4lf %.4lf",2*r,2*r*pi,r*r*pi);
return 0;
}没什么好说的,就是套公式。
因为输入和输出都是双精度浮点数,就直接都用double了。
边栏推荐
- 搭建一个QQ机器人叫女友起床
- Liujinhai, architect of zhongang Mining: lithium battery opens up a Xintiandi for fluorine chemical industry
- Several practical software sharing
- Gorm advanced query
- I have been promoted. How can I get along with my former colleagues at the same level?
- Unity技术手册 - 生命周期LifetimebyEmitterSpeed-周期内颜色ColorOverLifetime-速度颜色ColorBySpeed
- 2021-05-07构造器
- The era of copilot free is over! The official version is 67 yuan / month, and the student party and the defenders of popular open source projects can prostitute for nothing
- 炫酷相册代码,祝对象生日快乐!
- 2021-05-11instanceof和类型转换
猜你喜欢

利用华为云ECS服务器搭建安防视频监控平台

卧槽,最惊艳的论文神器!

Lying trough, the most amazing paper artifact!

Golang quick start (3)

一个优秀速开发框架是什么样的?

Build a QQ robot to wake up your girlfriend

Shengshihaotong enables high-quality development with industrial Digitalization

Fill the pit for repvgg? In fact, it is the repoptimizer open source of repvgg2

Too helpless! Microsoft stopped selling AI emotion recognition and other technologies, saying frankly: "the law can not keep up with the development of AI"

Go language JSON processing
随机推荐
Fill the pit for repvgg? In fact, it is the repoptimizer open source of repvgg2
Three implementation methods of distributed lock
The era of copilot free is over! The official version is 67 yuan / month, and the student party and the defenders of popular open source projects can prostitute for nothing
2021-05-11instanceof和类型转换
2021-04-27类和对象
Golang 快速上手 (1)
AI芯片技术-2022年
Multithreaded exercises
Distributed common interview questions
2021-04-16递归
2021-04-12 the first implementation of linked list!!!
同花顺是炒股的么?在线开户安全么?
Unity技术手册 - 形状(Shape)子模块 - Sprite、SpriteRenderer及生命周期内速度(Velocity over Lifetime)
2021-04-16 recursion
MySQL-02.工作中对索引的理解
Numerical calculation method
Mysql 的Innodb引擎和Myisam数据结构和区别
XML related interview questions
文件IO(1)
R和RStudio下载安装详细步骤