社区
C语言
帖子详情
A>B?A:B
峥嵘思想家
2008-08-06 11:56:30
各位高手请问A>B?:A:B在C语言中怎样理解?
...全文
4174
34
打赏
收藏
A>B?A:B
各位高手请问A>B?:A:B在C语言中怎样理解?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用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]
如此强大的力量
2008-09-01
打赏
举报
回复
[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)
头文件免费下载
代码: // stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #if !defined(AFX_STDAFX_H__C4B5DA9B_21EA_47D6_9253_A4245E58FBF5__INCLUDED_) #define AFX_STDAFX_H__C4B5DA9B_21EA_47D6_9253_A4245E58FBF5__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // TODO: reference additional headers your program requires here //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_STDAFX_H__C4B5DA9B_21EA_47D6_9253_A4245E58FBF5__INCLUDED_)
java反编译工具jad 1.5.8g(可以反编译jdk1.5,1.6)
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 <
50道JAVA基础编程练习题
很好的java基础编程练习题,对初学java编程者有所帮助,谢谢。
4-6 JS语法(条件语句:if、switch、&&、||、A?B:C)
总结:条件语句 if…else… switch A?B:C 如果A为真,则执行B,否则执行C A && B fn && fn() 如果fn存在,则调用fn A || B A = A || B 如果A存在,则A等于A,否则A等于B 一、if语句 如果…那么… 1.语法 if(表达式){语句1}else{语句2} 如果表达式成立,那么语句1执行,如果不成立,则语句2执行 {}在语句只有一句的时候可以省略,但不建议这么做 2.变态情况 表达式里可以变态,如 a = 1
Java三元运算符问题:condition?a:b
conditions?a:b,这里有 int a, float b,如果说condition = true,则a会先转换成float,然后输出。可见这里 a,b必须是可以统一的数据类型
C语言
70,040
社区成员
243,246
社区内容
发帖
与我相关
我的任务
C语言
C语言相关问题讨论
复制链接
扫一扫
分享
社区描述
C语言相关问题讨论
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章