• 2021-04-14 问题

    从键盘上输入一个正整数n,计算并输出n的阶乘。 例如,如果从键盘上输入8, 程序的运行结果应为:The result is: 40320。 #include #include #include long fac( int n ) { int i; long t=1; for( i=2;i<=n;i++) t = t*i; return (t); } main() { int n; long int s; clrscr(); printf("Enter an integer number:"); /************found************/ ____(1)____; s = fac(n); /************found************/ printf("The result is : ____(2)____ ",s); }

    从键盘上输入一个正整数n,计算并输出n的阶乘。 例如,如果从键盘上输入8, 程序的运行结果应为:The result is: 40320。 #include #include #include long fac( int n ) { int i; long t=1; for( i=2;i<=n;i++) t = t*i; return (t); } main() { int n; long int s; clrscr(); printf("Enter an integer number:"); /************found************/ ____(1)____; s = fac(n); /************found************/ printf("The result is : ____(2)____ ",s); }

  • 1