• But when you start writing programs, especially when we get to web-based stuff where you want -- to check the user's input -- is it valid, is it an email address, -- and all these different scenarios -- it's actually often useful to be able to just enumerate them or rattle them off using this switching construct instead.

    但是当你看是写程序时,特别是当我们,使用基于网络的东西,你想要,检查用户的输入-,它是合法的吗?它是不是一个电子邮箱地址?,所有的这些场景-,实际上它常常是有用的,当你用枚举结构列举它们,或者用它来快速地来说出它们。

    哈佛公开课 - 计算机科学课程节选

  • The format is the same. I'm going to ask for some input, and then I am going to use that procedure to check, is this the right type of value. And I'm trying to use that to do the coercion if you like. Same thing if it works, I'm going to skip that, if it not, it's going to throw the exception.

    格式是一样的,我需要一些输入,然后我要用一个过程来检查,是否是正确的值,然后你就可以做强制转换了,如果能运行,那是一样的,我打算跳过这段,如果不正确,那就会抛出一个异常。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • I probably whip out a do while loop very rarely, but very often when programming games or any program that takes user input and has to check that user input and yell at the user if they're messing with you or aren't providing what's expected.

    我可能很少用do,while,循环,但常常是,当编制程序游戏或需要用户输入的程序是,需要检查用户的输入并提醒用户,如果他们干扰了你,或没有提供所期望的输入。

    哈佛公开课 - 计算机科学课程节选

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定