#include <stdio.h>int area(int a,int b){ int s=a*b;}int main(){ int a=1; int b=3; int s; int area(a,b); printf("%d\n",s); return s;}——————————————————————————在dos控制台运行的结果是如下:32767--------------------------------Process exited after 0.2116 seconds with return value 32767请按任意键继续. . .哪位老师同学能帮我看看到底是哪出错了。
1 回答
已采纳
Ivoth
TA贡献13条经验 获得超3个赞
#include <stdio.h>
int area(int a,int b){
return (a*b);//返回长宽的乘积
}
int main(){
int a=1;
int b=3;
int s;
s=area(a,b);//s接收返回值
printf("%d\n",s);
return 0;//这是主函数的返回值
}- 1 回答
- 0 关注
- 1337 浏览
添加回答
举报
0/150
提交
取消
