原文:實驗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