- 2
- 0
- 约3.45万字
- 约 42页
- 2018-03-28 发布于浙江
- 举报
[工学]c语言课后习题答案
16.4/*【例1.3】已知华氏温度0、20、…、200,求对应的摄氏温度。*/
#include stdio.h
void main()
{ double f, c; /* 变量定义 */
int lower, upper, step;
lower = 0; upper = 200;
step = 20; f = lower;
while (f = upper) { /* 循环计算 */
c = 5.0/9.0 * (f - 32.0);
printf(\t%7.0f %7.1f\n, f, c);
f = f + step;
}
}
16.5/*【例1.4】输入两个实数, 输出它们中的小的数*/
#include stdio.h
float min(float a, float b)
{ float temp ; /* 函数使用的变量的定义 */
if (a b) temp = a; else temp = b;
return temp ; /* 返回 temp 到调用 min() 函数处 */
}
void main()
{ float x, y, c; /* 变量定义 */
printf(输入x和y.\n);
scanf(%f%f
您可能关注的文档
- [工学]chapter4PolarSolutionsForPlanarProblems.ppt
- [工学]Chapter4nmr_中文.ppt
- [工学]chapter3内存储器.ppt
- [工学]Chapter6TheCompensationoftheLinearControlSystems.ppt
- [工学]chapter8 客户关系管理.ppt
- [工学]chapter9数值分析课件.ppt
- [工学]Chapter_07_Design_of_Linkage_Mechanisms.pdf
- [工学]Chapter52Concrete.ppt
- [工学]Chapter 8 Aseismic design of masonry structures.ppt
- [工学]Chapter_5_人体热湿反应.ppt
原创力文档

文档评论(0)