69,382
社区成员
发帖
与我相关
我的任务
分享
int a = 8;
//我想对这个变量a进行判断,如果a大于0的话,输出一句hello,不大于的话输出 world 但是一下语句提示没有左值,条件表达式语句必须得赋值给一个左值吗
a>0 ? printf("hello"); : printf("world"); //执行不了
a>0 ? printf("hello") : printf("world");
int a = 8;
//我想对这个变量a进行判断,如果a大于0的话,输出一句hello,不大于的话输出 world 但是一下语句提示没有左值,条件表达式语句必须得赋值给一个左值吗
printf("%s",a>0?"hello":"world"); //执行不了