F Then I'm going to print a capital F just % 1f C to be aesthetically interesting equals another %.1fc.
然后我将打印大写字母,使其比较美观的,等于另一个。
I looked at the directions that I printed out, but something isn't right.
我在看我打印出来的路线,但这可能有点问题。
So what I'm going to do, well, let's get rid of this print statement for now.
所以我想要做的,好吧,让我们先省去这个打印声明。
If you scroll back up on the printout or screen here, you'll see that you can actually not only declare function's prototypes, their general structure.
如果我回滚到打印输出或者这个屏幕,你们将看到你们不仅可以声明函数的原型,它们的一般结构。
I'm then printing bracket one, bracket two, bracket three, bracket dot, dot, dot up until the total number of arguments, 1 whatever that may be, and it's going to be at least one because the program always has a name.
然后我打印,括号等等等,知道打印完所有的参数,不管那个最大值可能是什么,它将至少为,因为程序总是有一个名字。
Among your printouts today, even though I generally won't bother printing slides since they're fairly minimalist, we will typically print source codes.
在你们打印出来的所有资料中,我最不屑于打印这些幻灯片了,它们都相当抽象,我一般会打印源代码。
OK, what I would like you to see is I've been printing out, as I went along, actually let's back up slightly and look at the code. There's merge sort.
好的,我想让你们看就是我运行过后,打印出来的结果,我们再回头看一下这段代码,这就是归并排序,输入一个列表。
I don't have to go read what it printed out in the screen. This has returned a value that I can use. Because I could do a test to say, is this a return value? If it's not, I'll do something else with it. So the binding is still there, it simply doesn't print it out.
我不想读到屏幕中打印出来的这行字,程序返回过一个我能够使用的值,因为我可以做个小测试,来说明这是否是返回的值,如果不是,我可以做一些其它的事,而这个绑定依然在这儿,没有打印任何东西。
I'm going to print here the list if we go into it, and print of the when we're done and then just return that.
注意接下我来我要做的事,运行到这里时会打印列表,并且当处理完成后会打印返回的列表。
But at the end of the day, this program does in effect nothing because I'm not printing the answer, I'm not saving the answer, I'm not doing anything with the answer.
但最终这个程序都不会做什么有效地事情,因为我没有把答案打印出来,我没有保存那个答案,我没有对那个答案做相应的操作。
I'm first printing the zero argument which I said is the name of the program itself.
我先打印参数,这是那个程序本身的名字。
cmp My handout's wrong, which I discovered this morning after I printed them all out.
还有,我的课堂手册有错误,我上午打印完才发现有错误。
I'm actually just going to do something simple first, print the arguments to this function.
我实际上将要先做点简单的东西,打印函数的参数。
Let's do a little Copy Paste down here so I can print out its size.
让我再做个复制粘贴,所以我能打印它的大小。
> >> David: F, c because I want to tell printf, "Use these values in those placeholders, these values in those format strings."
>,【无法辨认的声音】,>>,大卫:“f,c“因为我想告诉printf,“在那些占位符,和那个格式下打印这些值“
I print out -- and this is only wrapping - because of the big font -- I print out, "I demand that you give me a positive integer."
我打印出来--这个字符相互覆盖了,因为用的是大字体-,我打印:“我需要你给我一个正整数“
I then insist, okay, swap, and then I print out their values again.
我再强调,好的,交换好了,然后我再打印出,它们的值。
When I ran it up here, with the old Fib, and we printed the result, and I ran it with Fib 1 down here.
当我运行到这里,也就是老的Fib函数,我们打印这个结果,当我在下面调用Fib1时,也打印了结果。
stdio I don't even need standard IO because I'm not printing anything.
我甚至不需要,因为我不需要打印任何东西。
I go ahead and print out a small number.
我继续打印一个小数字。
It'll print, I think, 85 calls.
我想它会打印出85次调用。
I'm again, saying print argument's new line.
我再次指明,打印参数的新行。
> David: At some point in time, I'm going to have to have declared the variable as a float before I can then hand it to printf as the insertion value for that format strength.
>,大卫:在一个特定的时间,我将需要,声明float类型这样的变量,那样我就可以把它打印出来,像是格式化优点的插入值。
So if I print e to f of soccer, it will print the string football.
如果我要显示soccer的e到f变换的话,打印出来的就是football了。
That's what you expect, but what's going to happen if I print L 2?
你们期望的是怎么样的?,我去打印下L2会显示什么呢?
It's going to print out even or odd, depending on whether the value I put in, which is x in this case, is even or odd.
它会打印奇数或者偶数,这取决于我输入的值,也就是这个例子中的x,是奇数还是偶数。
I then print X's now such and such, initializing dot, dot, dot.
然后我打印X的值,如此这般,初始化点,点,点。
So the very last two lines of code I'm saying this, s2 the original string is s1, the copy of the string is s2, but if I haven't lost you, what are we really going to see when we print this?
最后两行代码是这样的,原字符串是s1,那个字符串的拷贝是,但是如果我没有忘记,当我们打印的时候,我们将看到什么?
Let's check it out. I've written a little bit of a test script here, so if we test cell sort, and I've written this so that it's going to print out what the list is at the end of each round, OK.
我们来检查检查,我写了一个小测试脚本,我写这个脚本来测试单元排序,它能够打印出每一轮结束后,链表的是什么样子的。
Glancing at the bottom, this is pretty arbitrary, but I chose to format my string as follows: % 1f so at the bottom here I'm printing out %.1f, which quick sanity check means print just one digit after the decimal place.
看下这个底部,这个是相当随意的,但我选择把我的字符串格式化成这样:,所以在这个底部我打印输出,提醒一下,这是一个只打印出,小数点后一位的方法。
应用推荐