if(n=5)与if(n==5)if与whether的区别别

whether和if的区别
&&&&&&&&&&&&&&&&&&&&&&&&&&
whether和if的区别
1.whether和if均可用来引导主语从句,但if引导的从句不能位于句首。
如: Whether they win or lose is all the same to
他们是赢是输於我都一样.(此时whether不能换作if )
doubtful whether there'll be any seats
说不上还有没有空座位了. (此句whether能换作if)
2.whether和if均可用来引导宾语从句。
如:①I don't know whether/if I will be able to come.我不知道我是否能来.
②She asked me whether/if I was interested in working for
her.她问我是否有兴趣为她工作。
③We'll be told tomorrow whether we should take the exam or
not.我们明天才知道是不是应该参加考试.
&④I asked him whether he had done all the work
himself or whether he had had any assistance.
我问他这些工作都是他自己做的还是别人帮他做的.
( 注意: 在两个供选择的从句之间若用or字, 则须重复whether一字. )
⑴当强调宾语从句并将其提前时只能用whether。
如:Whether I'll have time to go with you I am not
sure.我很难说我们是否有时间跟你们一起去。
⑵ 从句作介词宾语时只用whether不用if。
如:She was undecided about whether she should accept his
offer.她拿不定主意应该不应该接受他的好意
⑶ 当whether和or not连用时,只用whether不用if。当or
not放在whether引导的从句句尾,则可以&&&&&&&&
用if来替换。
如: I don’t know whether or not he will come.我不知道他是不是回来。
I'll be happy whether/if I get the job or not我能不能得到那份工作都一样高兴
⑷ 当whether和or 连用表示明确的选择时,只用whether不用if。
如:He asked me whether I wanted to go there by train or by
bus.他问我是想乘火车还是坐公共汽车去那里。
&He hesitated about whether he should drive or
take the train.他开车去还是坐火车去, 犹豫不决
注:whether 和or 连用还可以引导让步状语从句,此时也不用if。
&&& 如:We'll go
on with the work, whether we can find the necessary tools or
不管我们能否找到所需的工具,我们要把这件工作做下去。
&&&&&&&&&&
&&Whether or not it rains /
Whether it rains or not, we're playing football on Saturday.
&&&&&&&&&&&&&
无论下不下雨, 我们星期六一定踢足球.
&&& ⑸
动词discuss,decide,consider等后习惯上也常用Whether引导从句,不用if。
discussed whether they should leave at
once.他们讨论了是否应该马上离开。&
We discussed whether the house should be sold.&
我们讨论了这房子是否应卖掉。&&
3.表语从句用whether引导不用if.
如:①The doubt was whether you had broken the beautiful
vase.&&&&&&
疑问是你是否打坏了这只漂亮的花瓶。
4. 同位语从句用whether引导不用if.
如:①The question whether we'll build another lecture building hasn't
been settled.
是否要另建一幢教学楼的问题还未决定。
5. 在动词不定式之前,只能用whether,不能用if。
如:①The question is whether to go to Munich or
Vienna.&&&&&
问题是去慕尼黑还是去维也纳.
& ②She doesn't knows whether to get married now or
wait.&& 是否现在结婚或是等待她不知道。
& ③We were wondering whether to go today or
tomorrow.&&&
我们弄不清是今天走还是明天走.
& ④I'm not sure whether to resign or stay
on.&&&&&&&&&&&&&&
我拿不准主意是辞职还是留任.
强化练习:
1. The question has not been answered ____ Taiwan will be included
on the Olympic torch relay route.
A.that&&&&&&
B.whether&&&&&&
C.which&&&&&&&
2. You have not yet answered my question _____ I can join in the
party tonight or
whether&&&&&&&&&&&&&&&
if&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
that&&&&&&&&&&&&&&&&&&&&&&&&
3.— I d like to invite you to a party this evening.
— Thank you, but _____ I’ll be free I m not sure at the
while&&&&&&&&&&&&&&&&&
if&&&&&&&&&&&&&&&&&&&&&
when&&&&&&&
D. whether
4.---What are you anxious about?
---___________
If we succeed&& B.That we can
succeed&&&&&
C. Do we succeed&& D.Whether we
can succeed
5. Only when _____ the painting _____ decide ______the painting is
buying.&&&
A. he sees, he can
,whether&&& B.
does he see, can he,&&
C. he sees, can he
,whether&&& D.
sees he, he can,that
6. _____ English is his favourite subject
&&& A. I asked
B. I asked him that whether C. I asked him
D. I asked him which
7. _____ they’ll go to the Summer Palace ____ the weather.
&&& A. If;
B. W depends upon&& C.
W depended
D. If; depended upon
8.It isn’t quite _____ ______ he will be present at the
whether&&&&
whether&&&&
9. _____ the 2008 Olympic will be held in Beijing is not known
Whether&&&&
Whenever&&&&
10. No one was sure _____ he would be asked to speak next
whether&&&&
11. It is still a question to us all _____ there is any living
thing in some other places in the space.
whether&&&&
which&&&&&&
12. I doubt _____ he will come here on time.
whether&&&&&
13.&&& The point
is not who said the words, _____ they are true or not.
whether&&&&
whether&&& C.
D. and how
14. “What did he ask you?” “_____ I would be late.”
D. Whether
15. He treated all the people around him,______he knew or he didn't
know,______.
friendly&&&&&&&&&&&&&&&&
B. whether, friendly
C. if, in a friendly
D. whether, in a friendly way
16. At the meeting, we discussed _____ we should employ more
workers.
B. whether&&&
D.不填
Answers: BADDC ABCAB ABADD B
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。| 商品搜索:
| 热门摄影摄像产品线: |
& 宾得FA645 150-300mm F5.6ED[IF]参数
参数显示:显示全部参数隐藏相同参数
产品名称 &&&产品图片
产品价格&&&价格趋势网上购买-&&&主体 &&&镜头昵称-&&&镜头定位-&&&品牌-&&&型号-&&&类型远摄变焦&&&镜头类型变焦镜头&&&镜头用途超长焦变焦镜头&&&卡口类型宾得KA卡口&&&防抖-&&&功能-&&&口径-&&&翻新类型-&&&规格 &&&适用机型-&&&13组15片&&&焦距f=150-300mm&&&最近对焦距离2.000m&&&微距放大率-&&&最近摄距-&&&-&&&67mm&&&遮光罩-&&&尺寸(直径 x 长度)-&&&重量-&&&最大光圈F5.6&&&F45&&&自动对焦马达-&&&视角(相当于APS-C)尺寸-&&&其他 &&&特色-&&&特性 &&&特性-&&&基本参数 &&&镜头分类-&&&对焦方式自动&&&变焦方式-&&&APS焦距225-450mm&&&光学参数 &&&防抖功能-&&&对焦驱动系统-&&&-&&&视角范围21°- 13.5°&&&镜头直径80mm&&&镜头长度201mm&&&镜头重量920g&&&其他参数-&&&其它参数 &&&简介-&&&包装清单-&&&
热门镜头热门宾得镜头关注该产品的用户还喜欢10000元以上镜头
图文精选高清大图推荐文章论坛热帖????????????????????热门产品推荐产品??????????????????????????????
,,最精彩的内容尽在泡泡网
&&Copyright &
PCPOP, All Rights Reserved 泡泡网 版权所有
求鉴定更多#include&stdio.h& main() { int a=7,b=6,c=5; if(a&c) b=a;a=c;c=b; printf(&%d,%d,%d\n&,a,b,c); }_百度知道
#include&stdio.h& main() { int a=7,b=6,c=5; if(a&c) b=a;a=c;c=b; printf(&%d,%d,%d\n&,a,b,c); }
#include&stdio.h&main(){int a=7,b=6,c=5;if(a&c){b=a;a=c;c=b;}printf(&%d,%d,%d\n&,a,b,c);}这两个程序有什么区别 啊 啊啊!!在线等!!!
提问者采纳
#include&stdio.h&main(){int a=7,b=6,c=5;if(a&c){b=a;a=c;c=b;}printf(&%d,%d,%d\n&,a,b,c);}if语句,while,for语句如果不加大括号的话,只会执行他们后的第一个语句
其他类似问题
按默认排序
其他3条回答
if(a&c) b=a;a=c;c=b;和if(a&c){b=a;a=c;c=b;}区别啊前面无论如何都会执行a=c;c=b;而后一个不会
#include&stdio.h&应该独占一行。
不加大括号,只会执行离if最近的语句
printf的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁责任编辑:
求一个数组的最大值和最小值,一般的方法,我们用两个变量max和min,遍历一遍数组,每次遇到一个元素,就更新max和min,扫描一遍就得到了最大值和最小值。该方法共比较了2*N次。
本文用分治法将2*N次的比较,减少到了1.5*N次,本文主要练习对分治法的理解。
分治算法由两部分组成:
分(divide):递归解决较小的问题(基本情况除外)
治(conquer):从子问题的解构建原问题的解。
分治算法的特点:
1、代码中至少含有2个递归调用,只含有一个递归调用的算法,不是分治算法
2、每个递归调用解决的是不相交的问题
3、分治算法必然对递归调用的返回值进行了合并
简单来说,分治算法就是至少2次递归调用、子问题不相交、必然合并子问题的解。
本题目解决求数组的最大值最小值,可以将问题分解为数组左边的最大值最小值、右边的最大值最小值、它们的最大值最小值比较后整个数组的最大值最小值。
以下是测试代码,加上了详细的注释:&
#include&&iostream&&
using&namespace&&
struct&MaxMin{&
int&arr[]&=&{5,6,8,3,7,9};&
//来自程序员求职网
MaxMin&getMaxMin(int&*arr,&int&beg,&int&end){&
& & if(end-beg&=1){&
& & & & MaxMin&&
& & & & if(arr[beg]&arr[end]){&
& & & & & & tmp.max&=&arr[beg];&
& & & & & & tmp.min&=&arr[end];&
& & & & & & &
& & & & }&else&{&
& & & & & & tmp.max&=&arr[end];&
& & & & & & tmp.min&=&arr[beg];&
& & & & }&
& & & & return&&
& & MaxMin&leftMaxMin&=&getMaxMin(arr,&beg,&beg+(end-beg)/2);&
& & MaxMin&rightMaxMin&=&getMaxMin(arr,&beg+(end-beg)/2+1,end);&
& & int&maxv=0,minv=0;&
& & if(leftMaxMin.max&rightMaxMin.max){&
& & & & maxv&=&leftMaxMin.&
& & }&else&{&
& & & & maxv&=&rightMaxMin.&
& & if(leftMaxMin.min&rightMaxMin.min){&
& & & & minv&=&rightMaxMin.&
& & }&else&{&
& & & & minv&=&leftMaxMin.&
& & MaxMin&&
& & tmp.max&=&&
& & tmp.min&=&&
& & return&&
void&main(){&
& & MaxMin&tmp&=&getMaxMin(arr,0,6-1);&
& & cout&&tmp.max&&"&"&&tmp.min&&&
& & system("pause");&
结果截图:
分治算法的一些应用:
1、线性时间的树遍历算法
2、归并排序
3、快速排序
相关新闻:EXCEL使用技巧集合(目前见到最实用的)-INDIRECT函数的使用_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
评价文档:
4页免费35页免费28页免费2页免费330页4下载券 2页免费2页1下载券89页2下载券11页免费44页1下载券
喜欢此文档的还喜欢2页免费75页免费75页免费95页1下载券4页免费
EXCEL使用技巧集合(目前见到最实用的)-INDIRECT函数的使用|E​X​C​E​L​使​用​技​巧​集​合​(​目​前​见​到​最​实​用​的​)​-​I​N​D​I​R​E​C​T​函​数​的​使​用
把文档贴到Blog、BBS或个人站等:
普通尺寸(450*500pix)
较大尺寸(630*500pix)
你可能喜欢

我要回帖

更多关于 whether和if的区别 的文章

 

随机推荐