如果范围内的数字退出,则告诉语法执行代码 [英] Tell the syntax to execute code if number in range otherwise exit

查看:63
本文介绍了如果范围内的数字退出,则告诉语法执行代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ħ!每个人


这是一个小问题。


如果你必须执行一个代码,你会怎么写,如果一个数字来自6到10?其他任何事情都不会执行该操作,并可能用于执行其他操作,例如退出。我也希望你展示的语法是常识,这意味着所有大大小小的程序员都会知道。

H! Everyone

Here is one small question.

What do you people write if you have to execute a code if say, a number is from 6 to 10? Anything else does not execute that action, and may be used to do something else, like exit. I also hope the syntax you would show would be common knowledge, meaning all programmers big and small would know.

展开 | < span class =codeLinkonclick =selectAll(this);>选择 | 换行 | 行号

推荐答案

有几种方法可以对此进行编码。这是一个:

There are several ways to code this. Here is one:

展开 | 选择 | Wrap | 行号


对我来说,如果它的范围是6-10

for me, if it''s a range such as 6-10

展开 | 选择 | Wrap | 行号


H!再次WeaknessForCats

并且感谢DivideBy0。


没什么,只是我发现的一件小事,我认为因为缺乏例子而没有人知道,但是我认为WeaknessForCats已经给出了一个例子,它恰好是相同的 - 所有人要做的就是从WeaknessForCats给出的最后一个例子中删除括号。


谢谢你向我展示了其他的例子。我也需要知道这些,因为整个网络都没有显示出这些;我不知道为什么他们忘记了这种情况。


我是新手,只是C ++的一半,研究数据结构(或者更确切地说是操作员,再次创建部分 - 上述网站上每章的章节文件。


谢谢


HDW
H! again WeaknessForCats
and thanks DivideBy0.

Well nothing, just a minor thing I discovered which I thought was no one may know because of lack of examples, but I think WeaknessForCats has already given an example of, which happens to be the same-- all one has to do is remove the braces from the last example given by WeaknessForCats.

Thank you for showing me other examples of this, too. I needed to know these too, since the whole of net does not show any of these; I don''t know why they have forgotten this situation.

I am a newbie, just half way through C++, studying Data Structures (or rather Operators, doing it again creating section-by-section documents for each of the chapters) on the site mentioned above.

Thanks

HDW


这篇关于如果范围内的数字退出,则告诉语法执行代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆