主题:新手求助 请问哪里错了?
本人刚学c语言,这个求两数平均值的程序我一直不懂哪里写错了...
# include <stdio.h>
int main(void)
{
printf("请输入两数:");
int a,b,g = (a+b)/2;
scanf("%d %d",&a,&b);
printf("g =%d\n",g);
return 0;
}
输出结果都是:
g =-858993460
有哪位帮我解答一下......
# include <stdio.h>
int main(void)
{
printf("请输入两数:");
int a,b,g = (a+b)/2;
scanf("%d %d",&a,&b);
printf("g =%d\n",g);
return 0;
}
输出结果都是:
g =-858993460
有哪位帮我解答一下......