两求群里精英解答16道题求解答

小学二年级上册数学应用题大全_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
小学二年级上册数学应用题大全
上传于||暂无简介
阅读已结束,如果下载本文需要使用1下载券
想免费下载本文?
定制HR最喜欢的简历
下载文档到电脑,查找使用更方便
还剩2页未读,继续阅读
定制HR最喜欢的简历
你可能喜欢另解,c/c++有趣的经典笔试题:不用判断语句求得两个整数的最大值 - 博客频道 - CSDN.NET
jiese1990的专栏
写博客不仅仅是一种知识分享,更是一种学习方法
分类:c/c++
另解,c/c++笔试题:不用判断语句求得两个整数的最大值
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & jiese1990
There are two int variables: x and y, don’t use “if”, “? :”, “switch”or other judgementstatements, find out the biggest one of the two numbers.
有两个int型的整数:x,y;不使用&if&,&? :&,&switch&等判断语句!找出a、b中最大的数!
过两天要去笔试,于是这两天开始看些往年的笔试题;
今天看到已一个比较有趣的笔试题!第一眼看到这个题目就觉得特有意思!于是就拼命的想求解答案!想了那么20来分钟,还是没有想到求解方案,很想很想查看答案,但是,心想,要是自己能独立解出,介个题,那肯定会很爽很爽的...于是乎终于憋出了个答案,兴奋不已啊!
int biger(int x,int y)
bool b=x&y; //我想这个应该不算是judgement statements;x&y应该叫做比较表达式吧!而题中也为要求不能使用&,&的比较表达式吧!
return b*x+(!b)*y;
看到题目后的几个思路
思路1:不用判断语句,那么可以通过位运算来求的较大者!我们有a=x&y;b=x|y;c=~x;d=~y;
& & & & & 问题是,我要怎么通过a,b,c,d;和运算符来求得结果;想了半天,未果;于是寻求其它思路。
思路2:有没有什么数学表达式可以直接求得结果!最有可能通过使用x+y,x-y两个式子来求的结果!想了许久,又未果!
思路3:可以通过一个值b来代表x和y那个大,这个数必须要莫是0(代表y更大),要么是1(代表x更大)!然后通过b*x+(!b)*y求的结果!然后很自然的可以想到用一个bool变量!然后就想出了如上答案!
想到答案后,果然很爽很爽...
然后查看答案,本以为答案会是跟我想的一样!事实往往不会是我想当然的那样(我已经习惯了这一点)!
我发现答案更神奇,居然跟我思路2是一路货色(可惜我没有想到啊)!:( ( a + b ) + abs( a - b ) ) / 2;
可是很快我就觉得abs()不能用,我觉得它的实现就是用了判断语句!于是剖开源码:(果不其然)
int __cdecl abs (int number)
return( number&=0 ? number : -number );
该方法是变相的使用了&? :&;
我想一个数的正负不就是由最高位决定,如果最高位为1,那么就是负数,如果最高位为0,那么就是正数!很明显可以通过这点求绝对值!
但我没心思去想怎么求绝对值了,于是就直接google找到了答案!
这个思路的答案在,该文章中有源码!
然后我直接google:不用判断语句,获得两个数中的较大者;
找到了很多帖子讨论这个面试题!
找到了很多解决方法,但是没有找到和我想到的答案类似的答案!所以记录下来!
排名:千里之外
(17)(1)(3)(4)(1)(1)(5)(0)(1)(2)后使用快捷导航没有帐号?
本贴相关题目
Prices at the producer level are only 1.3 percent higher now than a year ago and are going down, even though floods in the Midwest and drought in the South are hurting crops and therefore raised corn and soybean prices.Athan a year ago and are going down, even though floods in the Midwest and drought in the South are hurting crops and therefore raisedBthan those of a year ago and are going down, even though floods in the Midwest and drought in the South are hurting crops and therefore raisingCthan a year ago and are going down, despite floods in the Midwest and drought in the South, and are hurting crops and therefore raisingDas those of a year ago and are going down, even though floods in the Midwest and drought in the South hurt crops and therefore raiseEas they were a year ago and are going down, despite floods in the Midwest and drought in the South, and are hurting crops and therefore raising
正确答案: B
更多相关帖子
查看: 1380|回复: 12
在线时间 小时
Prices at the producer level are only 1.3 percent higher now than a year ago and are going down, even though floods in the Midwest and drought in the South are hurting crops and therefore raised corn and soybean prices.
A than a year ago and are going down, even though floods in the Midwest and drought in the South are hurting crops and therefore raised&&分析A选项
B than those of a year ago and are going down, even though floods in the Midwest and drought in the South are hurting crops and therefore raising&&分析B选项
C than a year ago and are going down, despite floods in the Midwest and drought in the South. and are hurting crops and therefore raising&&分析C选项
D as those of a year ago and are going down, even though floods in the Midwest and drought in the South hurt crops and therefore raise&&分析D选项
E as they were a year ago and are going down, despite floods in the Midwest and drought in the South, and are hurting crops and therefore raising&&分析E选项
这里的those of 为什么不能省略呢
看成两个是状语的比较
而OG这一题为什么又可以省略呢
93、Heating-oil prices are expected to be higher this year than last because refiners are paying about $5 a barrel more for crude oil than they were last year.
(A)& & Heating-oil prices are expected to be higher this year than last because refiners are paying about $5 a barrel more for crude oil than they were
(B)& & Heating-oil prices are expected to rise higher this year over last because refiners pay about $5 a barrel for crude oil more than they did
(C)& & Expectations are for heating-oil prices to be higher this year than last year’s because refiners are paying about $5 a barrel for crude oil more than they did
(D)& & It is the expectation that heating-oil prices will be higher for this year over last because refiners are paying about $5 a barrel more for crude oil now than what they were
(E)& & It is expected that heating-oil prices will rise higher this year than last year’s because refiners pay about $5 a barrel for crude oil more than they did
在线时间 小时
之前回答过这个问题 但是不知道是否正确 
第一个例子now 是副词 与一般的时间状语有区别 如果改成 Prices at the producer level are only 1.3 percent higher this year than a year ago. 就应该是正确的
第二句话第一是省略了year 因为不引起歧义 第二比较对象都有相应的状语结构 所以正确
在线时间 小时
再顶一下 谢谢楼上答复 还有其他吗
在线时间 小时
第一题思考:
A:raised应该是raising, 删除
B:好像对了,留着
C:despite后面不应该是个句子,(你可能写的不对,那个地方不应该是句号,请纠正)
DE:as应该是than
其实这里AB比较都对,A是 B是prices vs those
A:看起来没问题留着
B:rise higher有问题,但是不是很严重,留着
C:expect用了名词,复杂,不好,放心删除
D:it is the ...that绝对复杂,放心删除
A vs B,to be higher &to rise higher.B不好,删除。
A里面比较:this year vs last (year) 和refunere are&&vs they were.
B:refiner pay vs they did, 比较都对了。
解决你的问题:在比较中,时间可以比较时间,动词可以比较动词,系动词可以比较系动词,
然后,主谓可以比较主谓(这时候通常用that of 或者those of),
those of的使用取决于比较对象而不是 省略问题。
在线时间 小时
本帖最后由 elusive 于
11:51 编辑
第一题思考:
A:raised应该是raising, 删除
B:好像对了,留着
C:despite后面不应该是个句子,(你可能写的不对,那个地方不应该是句号,请纠正)
DE:as应该是than
其实这里AB比较都对,A是 B是prices vs those
A:看起来没问题留着
B:rise higher有问题,但是不是很严重,留着
C:expect用了名词,复杂,不好,放心删除
D:it is the ...that绝对复杂,放心删除
A vs B,to be higher &to rise higher.B不好,删除。
A里面比较:this year vs last (year) 和refunere are&&vs they were.
B:refiner pay vs they did, 比较都对了。
解决你的问题:在比较中,时间状语可以比较时间状语,主谓比主谓,主系比较主系。后面的主语通常是those of/that of,如果不是人。是人的话,they,he, she...
those of的使用取决于比较对象而不是 省略问题。
在线时间 小时
楼主提了个好问题!为了不误人子弟,我是引用曼哈顿论坛的讨论。
RON认为第一题的A选项中的比较结构是正确的,即比较时间状语“now”和a year ago“。
该选项的错误在与后半句的”raised“。
原帖链接:/gmat/forums/post117480.html#p117480
在线时间 小时
楼主提了个好问题!为了不误人子弟,我是引用曼哈顿论坛的讨论。
RON认为第一题的A选项中的比较结构是正确 ...
谢谢!同意!
在线时间 小时
楼主提了个好问题!为了不误人子弟,我是引用曼哈顿论坛的讨论。
RON认为第一题的A选项中的比较结构是正确 ...
感谢 !刚好在困惑这两道题!
在线时间 小时
据说编OG和编答案的不是一伙人!
在线时间 小时
don't forget—the OG answer keys are usually incomplete, and often incorrect.
the official PROBLEMS are essentially flawless, but the official answer keys are not. (GMAC's all-stars, the people who write the problems, do not w GMAC 'outsources' that work to people of lesser talent, presumably to cut costs.)
所属分类: GMAT考试
正在浏览此版块的会员 ()
ChaseDream 论坛
All Rights Reserved.求解答,至少回答两道题,谢谢
妙妙系列06XC4
先写景物的
碧玉妆成一树高,万条垂下绿丝绦。
抒发思念的
每逢佳节倍思亲,遍插茱萸少一人。
为您推荐:
其他类似问题
扫描下载二维码}

我要回帖

更多关于 法律问题解答 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信