#include "stdio.h"int fun (int k,int *m){if (k%3) *m=k*k;else *m=k/3;}main(){int (*p) (int,int *),m;p=fun;(*P) (78,&m);printf ( "%d\n",m);}
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/22 13:22:44
#include "stdio.h"int fun (int k,int *m){if (k%3) *m=k*k;else *m=k/3;}main(){int (*p) (int,int *),m;p=fun;(*P) (78,&m);printf ( "%d\n",m);}
#include "stdio.h"
int fun (int k,int *m)
{if (k%3) *m=k*k;
else *m=k/3;}
main()
{int (*p) (int,int *),m;
p=fun;
(*P) (78,&m);
printf ( "%d\n",m);
}
#include "stdio.h"int fun (int k,int *m){if (k%3) *m=k*k;else *m=k/3;}main(){int (*p) (int,int *),m;p=fun;(*P) (78,&m);printf ( "%d\n",m);}
#include "stdio.h"
int fun (int k,int *m)
{if (k%3) *m=k*k; //如果k不能被3整除,则m所指变量赋值为k*k
else *m=k/3;} //能被3整除,则m所指变量赋值为k/3
main()
{int (*p) (int,int *),m; //定义了指向返回值是int型形参是int型和指向int型指针的指针变量p和int型变量m
p=fun; //把fun函数的入口地址赋给p
(*p) (78,&m);// p应该小写.调用p指向的函数即fun,实参是78和m的地址
printf ( "%d\n",m); //输出结果
}
这道题的答案应该是26