正在加载图片...
例编写自定义函数计算: C=号(f-32) 分析: 确定形参:求c必须知道f的大小,设形参为tmp 确定函数类型:函数的返回值即为c的值,设为实型。 程序: float ftoc(temp) float temp; &float c; c=(59.)*(temp-32); return c i例 编写自定义函数计算: 分析: • 确定形参:求c 必须知道 f 的大小,设形参为temp。 • 确定函数类型:函数的返回值即为c 的值,设为实型。 程序:float ftoc( temp ) float temp ; { float c ; c =(5./9.)*( temp – 32 ); return c ; } ( 32) 9 5 c = f −
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有