jus*_*ing 3 c if-statement conditional-operator
嘿,我想用方式 2 输入 if 语句,但我需要在那里放置一个 continue 并且它没有任何想法?方法 1 输入 if
if ( x+2 < 0) {
y=x+2;
}
else {
y=-(x+2);
}
Run Code Online (Sandbox Code Playgroud)
方法 2 输入 if
y=(x+2 < 0) ? x+2 : -(x+2)
Run Code Online (Sandbox Code Playgroud)
我的问题是如何以第二种方式输入 continue ,如下所示:
(x==1) ? continue : x+1 ;
Run Code Online (Sandbox Code Playgroud)
但这对我不起作用。