《C 程序设计语言》练习1-3
2024-10-08 20:00:43
#include<stdio.h>
/*当fahr=0,20,...,300时,打印华氏温度与摄氏温度对照表;
浮点数版本*/
main ()
{
float fahr,celsius;
int lower,upper,step;
lower=;/*温度表的下限*/
upper=;/*温度表的上限*/
step=;/*步长*/
fahr=lower;
printf("华氏温度与摄氏温度对照表\n");/*标题*/
while (fahr <= upper)
{
celsius=(5.0/9.0)*(fahr-32.0);
printf("%3.0f %6.1f\n",fahr,celsius);
fahr=fahr+step;
}
}
运行结果:
最新文章
- nodejs进阶(1)—输出hello world
- spring整合hibernate的时候报异常org.hibernate.HibernateException: createQuery is not valid without active transaction
- JDBC进行批处理
- sqlite 使用记录
- Java基础之写文件——缓冲区中的多条记录(PrimesToFile3)
- html5面向对象做一个贪吃蛇小游戏
- POJ 2528 Mayor’s posters
- bzoj3996
- spring util命名空间
- linux上svn连接visual svn server时ssl鉴权失败,问题解决(转)
- Codeforces554D:Kyoya and Permutation
- prototype原型解析
- ng-model,ng-value,ng-bind,{{}}----angularJS数据绑定
- 第二个项目:WC
- TYVJ P1039 【忠诚2】
- For、Foreach、和Parallel.For等简单的速度检测
- 【转载】C#工具类:Json操作帮助类
- CentOS7 配置静态 ip
- C++ 大学课堂知识点总结
- 6. 纯 CSS 绘制一颗闪闪发光的璀璨钻石