A>B?A:B

峥嵘思想家 2008-08-06 11:56:30
各位高手请问A>B?:A:B在C语言中怎样理解?
...全文
4174 34 打赏 收藏 转发到动态 举报
写回复
用AI写文章
34 条回复
切换为时间正序
请发表友善的回复…
发表回复
april0 2008-09-02
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 zhkefa 的回复:]
C = A>B?A:B;
就是
if(A > B)
C = A;
else
C = B;
[/Quote]
mifeixq 2008-09-02
  • 打赏
  • 举报
回复
写错了吧……

A>B?A:B ..
三目运算
相当于
if(A>B)
A
else
B
maomao_lyc 2008-09-02
  • 打赏
  • 举报
回复
看书阿。。。
汗。。。
最基本的东西啊
wanyoulin 2008-09-02
  • 打赏
  • 举报
回复
“?”前的对则执行A表达式,“?”前的不对执行B表达式
潇湘秦 2008-09-01
  • 打赏
  • 举报
回复
[Quote=引用 26 楼 cxxer 的回复:]
? :是C语言中唯一一个联单3目运算符,等价于

A>B?A:B

if (A>B)
返回A
else
返回B
[/Quote]
潇离 2008-09-01
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 k2eats 的回复:]
A>B?:A:B这个整体是一个表达式,
如果A>B表达式取值A否则取值B
[/Quote]
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 lgl09 的回复:]
如果A>B就执行A
否则就执行B
就是
if(A > B)
A;
else
B;
[/Quote]
ForestDB 2008-09-01
  • 打赏
  • 举报
回复
返回A,B的最大值。
cxxer 2008-09-01
  • 打赏
  • 举报
回复
? :是C语言中唯一一个联单3目运算符,等价于

A>B?A:B

if (A>B)
返回A
else
返回B
SeanHwang 2008-08-08
  • 打赏
  • 举报
回复
书上写的不能再清楚了~
小崔2022 2008-08-08
  • 打赏
  • 举报
回复
if(A>B)
A;
else
B;
lyc19810111 2008-08-08
  • 打赏
  • 举报
回复
如果 A>B 成立 的话 则表达式的值 为A 不成立则为B;
也就是 秋A B 中的 大数。
yangch_nhcmo 2008-08-08
  • 打赏
  • 举报
回复
[Quote=引用 19 楼 GeneGIS 的回复:]
理解为"?"之前的表达式成立,整个表达式取":"前的值,反之取":"后的值
[/Quote]
印第安爸爸 2008-08-08
  • 打赏
  • 举报
回复
理解为"?"之前的表达式成立,整个表达式取":"前的值,反之取":"后的值
elegant87 2008-08-08
  • 打赏
  • 举报
回复
? :是条件表达式!
如果 A>B成立的话 ,则表达式的值为A 不成立则为B;
也就是求解A和B中的最大的数。
lunarfan 2008-08-07
  • 打赏
  • 举报
回复
A>B?:A:B
先计算A>B如果为真返回A值,否则返回B值
龙小VIP 2008-08-07
  • 打赏
  • 举报
回复
如果A>B就执行A
否则就执行B
就是
if(A > B)
A;
else
B;
引用楼上的
9527他大爷 2008-08-07
  • 打赏
  • 举报
回复
如楼上
烂泥 2008-08-07
  • 打赏
  • 举报
回复
如果A>B就执行A
否则就执行B
就是
if(A > B)
A;
else
B;
K行天下 2008-08-07
  • 打赏
  • 举报
回复
A>B?:A:B这个整体是一个表达式,
如果A>B表达式取值A否则取值B
加载更多回复(13)
java反编译工具jad 1.5.8g支持 jdk1.5,jdk1.6。说明很多记住一个万能的命令基本就够用了。jad -sjava -r -8 -o **\*.class ---------------This is README file for Jad - the fast Java Decompiler.Jad home page: http://www.kpdus.com/jad.htmlCopyright 2001 Pavel Kouznetsov (jad@kpdus.com).0. Please read the disclaimer on the Jad home page.1. Installation.Unzip jad.zip file into any appropriate directory on your hard drive.This will create two files: - an executable file named 'jad.exe' (Windows *) or 'jad' (*n*x) - this README fileNo other setup is required.2. How to use JadTo decompile a single JAVA class file 'example1.class' type the following: jad example1.classThis command creates file 'example1.jad' in the current directory.If such file already exists Jad asks whether you want to overwrite it or not.Option -o permits overwriting without a confirmation.You can omit .class extension and/or use wildcards in the names ofinput files.Option -s allows to change output file extension: jad -sjava example1.classThis command creates file 'example1.java'. Be careful when usingoptions -o and -sjava together, because Jad can accidentally overwriteyour own source files.Jad uses JAVA class name as an output file name. For example, if classfile 'example1.class' contains JAVA class 'test1' then Jad will createfile 'test1.jad' rather than 'example1.jad'. If you want to specifyyour own output file name use the output redirection: jad -p example1.class > myexm1.javaOption -d allows you to specify another directory for output files,which are created, by default, in the current directory. For example: jad -o -dtest -sjava *.class (or jad -o -d test -s java *.class, which has the same effect)This command decompiles all .class files in the current directory <

70,040

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧