- 7
- 0
- 约1.49千字
- 约 10页
- 2023-11-17 发布于陕西
- 举报
感谢聆听 C语言程序设计 三、阶乘升级版 -2147483648~2147483647 三、阶乘升级版 本题要求实现一个打印非负整数阶乘的函数。 函数接口定义: void Print_Factorial ( const int N ); 其中N是用户传入的参数,其值不超过1000。如果N是非负整数,则该函数必须在一行中打印出N!的值,否则打印“Invalid input”。 三、阶乘升级版 裁判测试程序样例: #include stdio.h void Print_Factorial ( const int N ); int main() { int N; scanf(%d, N); Print_Factorial(N); return 0; } /* 你的代码将被嵌在这里 */ 三、阶乘升级版 一是数据存储,多个单元来存储超大整数 二是计算时借鉴乘法的竖式计算,一位位往前乘,并考虑进位的实现。 三、阶乘升级版 #includestdio.h #define radix 10000 #define max 1000 void Print_Factorial ( const int N ) { static int a[max]; int i,j,h,p,n; if (N0) { printf(Invalid
原创力文档

文档评论(0)