题目内容

程序输出结果是( )和( )。#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));}

(填写适当内容,完善程序功能)下面程序的功能是:最后一次输出1+2+3+…+100。#include int sum(int n){ _______ int s=0; s=s+n; return s; }void main(){ int i;for(i=1; i<=100; i++)printf("%d\n",_______);}

答案查题题库