1、printf是stdio.h里定义的,必须包含。
# include
2、函数默认返回类型是int,所以main函数需要return语句。
return 0;
3、printf("%d\n",h) 语句后少了分号。
4、# include "math.h" 没有用到,是不需要的。
# define R 10
# include
main()
{
int a=10,h;
h=10+R;
printf("%d\n",h);
return 0;
}
# define R 10
# include "stdio.h" //这里头文件问题应该标准io库stdio.h,math.h库这里没用
int main()
{ int a=10,h;
h=10+R;
printf("%d\n",h); //这里你少了“ ;”号
}
照你的意思,结果显示为 20.
错误:1 没有包含头文件 #include
2第六行少了分号。