习题6.5
来源:互联网 发布:epub制作软件安卓版 编辑:程序博客网 时间:2024/06/07 06:46
#include <stdio.h>#include <stdlib.h>int main(){ float c,f; for (f=0;f<=300;f=f+10) { c=5.0/9*(f-32); printf ("%f %f\n",f,c); } return 0;}
结果如下:
c,f
0.000000 -17.777779
10.000000 -12.222222
20.000000 -6.666667
30.000000 -1.111111
40.000000 4.444445
50.000000 10.000000
60.000000 15.555555
70.000000 21.111111
80.000000 26.666666
90.000000 32.222221
100.000000 37.777779
110.000000 43.333332
120.000000 48.888889
130.000000 54.444443
140.000000 60.000000
150.000000 65.555557
160.000000 71.111115
170.000000 76.666664
180.000000 82.222221
190.000000 87.777779
200.000000 93.333336
210.000000 98.888885
220.000000 104.444443
230.000000 110.000000
240.000000 115.555557
250.000000 121.111115
260.000000 126.666664
270.000000 132.222229
280.000000 137.777771
290.000000 143.333328
300.000000 148.888885
Process returned 0 (0x0) execution time : 0.020 s
Press any key to continue.
心得体会:
1.有float时小数保留六位,所以是5.0/9而不是5/9,否则结果输出c全为0.
- 习题6.5
- 习题6.5
- 习题6.5
- 习题6.5
- 习题6.5
- 习题6.5
- 习题6.5
- 习题6.5
- 习题6.5
- 习题6.5
- 习题6.5
- 习题6.5
- 习题6.5
- 习题6.5
- 习题6.5
- 习题6.5
- 习题6.5作业
- 习题6 6.5
- 互联网技术栈 『Contents Catalog』
- 习题4(4.3)
- MVP操作RecyclerView多条目SpringView,OKHttp封装请求网络
- 2017.11.04【NOIP提高组】模拟赛B组
- regular expression matching --python
- 习题6.5
- rostopic hz 降低
- centos如何在官网下载以前的版本
- C/C++中如何计算程序运行时间?
- Navicat for Mysql 连接失败10061
- 静态图片人脸识别 OpenCV3,Python3实现
- RabbitMQ消息通信,生产者发送消息给指定的消费者的消息队列
- Java for Web学习笔记(八六):消息和集群(1)一般性了解
- C#中获得本机ipv4的方法