为了账号安全,请及时绑定邮箱和手机立即绑定

求助,我的build过不了,该怎么办!

求助,我的build过不了,该怎么办!

慕尼黑8549860 2021-08-05 18:07:52
#include<stdio.h>void main(){int process();process();}void process(){int a,b;int c;int max(int a,int b,int *c);int min(int a,int b,int *c);int add(int a,int b,int *c);int plus(int a,int b,int *c);printf("please input a,b:");scanf("%d%d",&a,&b);max(a,b,&c);printf("%d\n",c);min(a,b,&c);printf("%d\n",c);add(a,b,&c);printf("%d\n",c);plus(a,b,&c);printf("%d\n",c);}void max(int n,int m,int *t){if(n>m)*t=n;else *t=m;}void min(int n,int m,int *t){if(n<m)*t=n;else *t=m;}void add(int n,int m,int *t){*t=n+m;}void plus(int n,int m,int *t){if(n>m)*t=n-m;else *t=m-n;}c语言,build过不了,主要是设计一个函数process。在调用它的时候,每次实现不同的功能。求高手指点!
查看完整描述

2 回答

?
白猪掌柜的

TA贡献1893条经验 获得超10个赞

int _tmain(int argc, _TCHAR* argv[])
{
void process();//====仔细看我这个
process();
return 0;
}
void process()
{
int a,b;int c;
void max(int a,int b,int *c); //====仔细看我这个
void min(int a,int b,int *c);//====仔细看我这个
void add(int a,int b,int *c);//====仔细看我这个
void plus(int a,int b,int *c);//====仔细看我这个
printf("please input a,b:");

查看完整回答
反对 回复 2021-08-09
?
繁星点点滴滴

TA贡献1803条经验 获得超3个赞

process函数里面不能再定义函数了

#include<stdio.h>
int process();
int max(int a,int b,int *c);
int min(int a,int b,int *c);
int add(int a,int b,int *c);
int plus(int a,int b,int *c);
printf("please input a,b:");
void main()
{
process();
}
void process()
{
int a,b;int c;

scanf("%d%d",&a,&b);
max(a,b,&c);
printf("%d\n",c);
min(a,b,&c);
printf("%d\n",c);
add(a,b,&c);
printf("%d\n",c);
plus(a,b,&c);
printf("%d\n",c);

}
void max(int n,int m,int *t)
{
if(n>m)
*t=n;
else *t=m;
}
void min(int n,int m,int *t)
{
if(n<m)
*t=n;
else *t=m;
}
void add(int n,int m,int *t)
{
*t=n+m;

}
void plus(int n,int m,int *t)
{
if(n>m)
*t=n-m;
else *t=m-n;
}



查看完整回答
反对 回复 2021-08-09
  • 2 回答
  • 0 关注
  • 292 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信