4 10 階乘計算公升級版 20分

2021-07-14 05:59:01 字數 609 閱讀 1195

#include void print_factorial ( const int n );

int main()

/* 你的**將被嵌在這裡 */

void print_factorial ( const int n )

else if(n<0)

else if(n>0&&n<10)

printf("%d",num);

}else

; pro[0]=1;//從1開始乘

int temp;//記錄b和c的乘積

int a=0;//a記錄pro[3000]的最高非零位

int b;//b記錄pro[3000]正在運算的位

int c;//c記錄從1-n的乘數

int d=0;//d記錄pro[b]*c的個位以上的數值

for(c=2;c<=n;c++)

//計算每個乘數c和數列pro相乘的結果

while(d!=0)

//當pro[a]最高非零位增加時的操作

}int e;//結果輸出位

for(e=a;e>=0;e--)

}}}

4 10 階乘計算公升級版 20分

本題要求實現乙個列印非負整數階乘的函式。void print factorial const int n 其中n是使用者傳入的引數,其值不超過1000。如果n是非負整數,則該函式必須在一行中列印出n 的值,否則列印 invalid input include void print factorial...

4 10 階乘計算公升級版

本題要求實現乙個列印非負整數階乘的函式。函式介面定義 void print factorial const int n 其中n是使用者傳入的引數,其值不超過1000。如果n是非負整數,則該函式必須在一行中列印出n 的值,否則列印 invalid input 裁判測試程式樣例 include void...

4 10 階乘計算公升級版

本題要求實現乙個列印非負整數階乘的函式。void print factorial const int n 其中n是使用者傳入的引數,其值不超過1000。如果n是非負整數,則該函式必須在一行中列印出n 的值,否則列印 invalid input include void print factorial...