相关代码 |
|
/*文件名:prog2.cpp*/ #include main() { int a=1; char c='a'; float f=2.0; printf("①:%d\n",a>0?a:-a); printf("②:%d\n",f==3.0?a=c); printf("③:%d\n",!(a==0)?!!a:!a); printf("④:%d\n",(f>0)?((a>0)?2:1):((a>0)?1:0)); printf("⑤:%d\n",(a>=0)?(a=1):(a=0)); printf("⑥:%d\n",(c=='A')?(0,1):(1,0)); }
相关资源 |
|