输入一个整数求此范围内的奇数并输出,为什么提示错误
# include<stdio.h>int main(void)
{
int a,x;
printf("请输入数据:");
scanf("%d",&x);
printf("%d\n",x);
for(a=1,a<=x,a++)
{
if(x%2==1)
{
printf("%d\n",a);
}
else
{
;
}
}
return 0;
}
//错误提示;
In function ‘main’:
8:21: error: expected ‘;’ before ‘)’ token
for(a=1,a<=x,a++)
^
8:21: error: expected expression before ‘)’ token
[此贴子已经被作者于2020-3-26 13:37编辑过]