int b=2;int fun(int*k) {b=*k=b;return (b);} main() {int a[10]={1,2,3,4,5,6,7,8} for (i=2;i
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/18 04:42:01
intb=2;intfun(int*k){b=*k=b;return(b);}main(){inta[10]={1,2,3,4,5,6,7,8}for(i=2;iintb=2;intfun(int*k
int b=2;int fun(int*k) {b=*k=b;return (b);} main() {int a[10]={1,2,3,4,5,6,7,8} for (i=2;i
int b=2;
int fun(int*k)
{b=*k=b;return (b);}
main()
{int a[10]={1,2,3,4,5,6,7,8}
for (i=2;i
int b=2;int fun(int*k) {b=*k=b;return (b);} main() {int a[10]={1,2,3,4,5,6,7,8} for (i=2;i
输出2个结果4和8
因为b被定义为全局变量,所以会记录前一次的结果.函数返回b.所以当i为2时,b加上b 也就是2+2 = 4,第二次时 b + b = 8,也就是4+4 = 8.
{b=*k=b;return (b);} b的值会把*k覆盖掉,
还不如直接写
for (i=2;i
#include int inc(int a){ return(++a); }int multi(int*a,int*b,int*c){ return(*c=*a**b); }typedef int(FUNC1)(int in);typedef int(FUNC2) (int*,int*,int*);void show(FUNC2 fun,int arg1,int*arg2){FUNC1 p=&inc;int temp =p(arg1);fun(&temp,&arg1,arg2);printf(
#include int b=2; int fun(int *k) {b=*k+b;return(b);} main() {int a[10]={1,2,3,4,5,6,7,8},
#include int inc(int a) { return(++a); } int multi(int*a,int*b,int*c) { return(*c=*a**b); }typedef int(FUNC1)(int in); typedef int(FUNC2) (int*,int*,int*); void show(FUNC2 fun,int arg1,int*arg2) { INCp=&inc; int temp =p(arg1)
#include int fun(int b[].int n) { int i.r=1:for(i=0:i
void main() {int t=1;fun(fun(t));} fun(int h) {stvoid main(){int t=1;fun(fun(t));}fun(int h){static int a[3]={1,2,3}; int k; for(k=0;k
#include int b=2; int fun(int*k) { b=*k+b;return(b);} main() {int a[10]={1,2,3,4,5,6,7,8}#include int b=2; int fun(int*k) { b=*k+b;return(b);} main() {int a[10]={1,2,3,4,5,6,7,8},i;for(i=2;i
int
main() {int t=1;fun(fun(t));} fun(int h){static int a[3]={1,2,3};int k; for(k=0;k
#include int b=3; int fun(int *a) { b+=*a; return(b); }void main(){ int a=2,b=2;b+=fun(&a);printf(“%d
”,b);读程序写出程序执行结果
void fun(int a,int b) { int t; t=a;a=b;b=t; } main()void fun(int a,int b){ int t; t=a;a=b;b=t; } main() { int c[10]={1,2,3,4,5,6,7,8,9,0}.i; for(i=0;i
#includestdio.h fun(int k,int *p) {int a,b;if(k==1||k==2)*p=1;else{fun(k-1,&a);fun(k-2,&b);*p=a+b#includestdio.h fun(int k,int *p){int a,b;if(k==1||k==2) *p=1;else{fun(k-1,&a);fun(k-2,&b);*p=a+b;}}main(){int x;fun(6,&x);printf(%d
,x);}执行
#include int inc(int a) { return(++a); } int multi(int*a,int*b,int*c) { return(*c=*a**b); } typedef int(FUNC1)(int in); typedef int(FUNC2) (int*,int*,int*); void show(FUNC2 fu
以下选项均为fun函数定义的头部,其中错误的是 .以下选项均为fun函数定义的头部,其中错误的是 .A.int fun(int x,int y[ ]) B.int fun(int x,int y[x])C.int fun(int x,int y[3]) D.int fun(int x,int *y)
int b=2;int fun(int*k) {b=*k=b;return (b);} main() {int a[10]={1,2,3,4,5,6,7,8} for (i=2;i
3、以下正确的函数定义是( ).A.double fun(int x,int y); {int z; z=x+y; return z;}3、以下正确的函数定义是( ).A.double fun(int x,int y); {int z; z=x+y; return z;}B.fun(int x,y) {int z; return z;}C.double fun(
#include void fun(int a, int b) { int t; t=a; a=b; b=t;main() { int c[10]={1,2,3,4,5,6,7,8,9,0), i; for (i=0; i
#include void fun(int a,int b) {int t; t=a;a=b;b=t; } main() {int c[6]={1,2,3,4,5,6},i;for(i=0;i
#include stdio.h void fun(int a,int b) { int t; t=a,a=b,b=t; } main() { int c[10]={1,2,3,4,5,6,7#include stdio.hvoid fun(int a,int b){int t;t=a,a=b,b=t;}main(){int c[10]={1,2,3,4,5,6,7,8,9,0},i;for(i=0;i