OK, says it says enter a float. I give it something that can be converted into a float, it says fine. I'm going to go back and run it again though. If I run it again, it says enter a float.
好了,看到他说输入一个浮点数,我输入它可以转换为浮点数的值,那没问题,我回过来再运行一遍,如果我再运行一遍。
OK. Having done this now, I can simply go ahead and run this, and in fact if I go up here to run, you'll see I've got both an option to check the module, though in this case I'm just going to run it.
好,讲完了这些,我可以去执行程序了,实际上如果我在这里运行,你们会看到我同样得到了,一个可以同时检查模块的选项,虽然在这个例子中我就是直接去运行程序了。
Now,having said that,let me just say as an addendum -- and this is my opinion,you could ignore it-- that things work in France.
根据前面提到过的,再谈一点补充,这是我自己的看法,你们可以忽视,法国社会运行顺利
So just to reinforce this, I could run gcc math2.c but I'm getting a little tired of this a.out convention and recall that there's this utility called "make" that right now doesn't really improve much, other than give it a better name.
所以我强调这点,我可以运行“gcc,math2,c“,但是我不是很喜欢a,out这个默认的名字,想取消它,那么这里有个叫做“make“的命令“,这个命令现在没有很大的改进,只是把用来更改名字用的。
I can tell you the answer, but that's because I've cheated, run the program before.
我可以告诉你答案,但这是因为我作弊了,我之前运行过一次程序。
OK. All right, let me show you one other tool that I want to use. Which is, I've written that piece of code, I ought to check it. Well, I could just run it, but another useful thing to do is, I'm, especially as I want to debug these things, is to simulate that code.
好,那么,让我给大家讲下,我想用的另外一个工具吧,也就是,我已经写好了这一块代码,我应该去检查检查,那么我可以去运行它,但是特别是当我想要调试代码的时候。
I could run it, it'll do the right thing.
我可以运行这个程序,程序没错。
I spotted an error here, I could have spotted it by running it on different test sets, and using prints things, another way of doing it, but this idea of at least simulating it on simple examples lets you check a couple of important questions.
操作么?我在这里发现了一个错误,我也可以通过运行不同的测试集,或者运用print声明来发现这个错误,但是至少应该用简单的例子来手工模拟下,代码的思想可以让你,对一些很重要的问题进行检验。
Well, what I always do in anything like this is, the first thing I do is, I run it on something where I can actually compute the answer in my head. So I get a sense of whether or not I'm doing the right thing.
好的,我常常在,这种问题中会做的是,我会做的第一件事是我,会先带入我可以心算的值来运行,因此我能够知道我是否做对了。
Imagine I have a little lamp, a little goose- one of those little gooseneck lamps, I'd put it on the table here, I'd put the height about a f-- about a foot off the table. And if I was really good, - I could hit, or time it so that when I hurt- yeah, try again. When I turn this on switch on in the lamp, at exactly the same time, I'm going to hit a key on my computer and start it running.
想象下我有一个那种小雁颈台灯-,我把它放在桌子上,大概离桌子,有一英尺那么高吧,这样挺好的,我可以打开-,或者关闭这灯,并在这同时,我可以让我电脑,开始运行。
Another way of saying it is, I've actually said, what did I use there, and , It's basically saying there is the first point, there's the second point, add them together and I get that point.
我要去做的是-对不起,再运行一次-好,你可以看到我已经把,这两个点的坐标值加到一块儿了,然后返回了r的值,我会让大家看到我们,实际上得到的是什么,这看起来不错,好,我做了正确的操作。
应用推荐