程序的输出结果是( )和( )。#include int n=30;void main(){ int n=20;{ int n=10;printf("%d", n); }printf("%4d\n", n);}
查看答案
程序输出结果是( )和( )。#include int fun(int a, int b){ return (a>b ? a+b : a-b); }void main(){ int x=5, y=8;printf("%d",fun(x,y));printf("%5d\n",fun(fun(x,y), 10));}
程序输出结果是( )和( )。#include int fun(int x){ static int y;y=y+10;return x+y;}void main(){printf("%d", fun(10));printf("%4d\n", fun(10));}
(填写适当内容,完善程序功能)下面程序的功能是:求阶乘之和s=1!+2!+3!+4!+5!+6!+7!+8!+9!+10!。#include int fact(int m){int i, t=1;for(i=1; i<=m; i++) _______;return t;}int sum(int n ){int i, _______;for(i=1; i<=n; i++)s=s+fact(i);return s;}void main( ){ int n=10;printf("%d\n", sum(n) );}
(填写适当内容,完善程序功能)下面程序的功能是:用递归算法求n的阶乘。#include int fact(int n){if(n==0||n==1) return _______;else return _______;}void main(){int n=5;printf("%d\n", fact(n));}