原文:实验5-2 编制程序,输入m、n(m≥n≥0)后,计算下列表达式的值并输出。 要求将计算阶乘的运算编写作函数fact(n),函数返回值的类型为float。

include lt stdio.h gt int main int m,n float result,sum float fact int n printf enter m and n: scanf d d , amp m, amp n 调用自定义的函数fact x sum fact m n result fact m fact n sum printf result . f n ,resul ...

2013-11-03 21:13 0 2838 推荐指数:

查看详情

编写函数fun,计算n!

#include <stdio.h> double fun ( int n ){ double result = 1.0 ;/************found************/ if (n==0) return 1.0 ; while( n >1 && ...

Sun Sep 17 01:36:00 CST 2017 0 2314
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM