标签:ansi 出版社 body ctr 输出 dex border alt nbsp
1
2
3
4
5
6
7
8
9
10
11
12
13
|
if (a) { return b; } else { return c; }
|
1
2
3
4
5
6
7
|
int a = 2; int c = 3; int b = (a > c) ? a : c; cout << "b:" << b << endl; |
1
2
3
4
5
|
int a = 1, b = 2, z, c = 3; z = a > b ? a : (b > c ? b : c); cout << "z:" << z << endl; |
1
2
3
4
5
|
int a = 1, b = 2, z; z = a > b ? a : b; //去了括号 cout << "z:" << z << endl; |
1
2
3
4
5
6
7
8
9
10
11
|
$a = (1 > 0) ? ‘zhen‘ : ‘jia‘ ; // 三目运算符 与下边if语句意思一样 if (1 > 0) { $a = ‘zhen‘ ; } else { $a = ‘jia‘ ; } |
标签:ansi 出版社 body ctr 输出 dex border alt nbsp
原文地址:https://www.cnblogs.com/braveheart007/p/10503547.html