1%10 So if you actually do in a program 11 percent 10, 1 what you'll get back is 1 because that is in fact the remainder of that arithmetic operation.
如果在编程里就是,返回,因为1是这个计算式的余数。
STUDENT: What does it mean, the operator used, when you were calculating the remainder between nine and five?
学生:这是什么意思,当你用这个运算符去算,9除以5的余数的时候?
But we'll use this over time but the percent sign essentially gives you the remainder.
在以后我们会用到,%给你的是余数。
And, at some level, there is some redundancy here.
在某种程度上说,这存在冗余数。
And when I'm done with the whole thing, before I end the increment of the variable, you know, when I'm done, I'm just not returning anything out.
在循环外面初始化它,然后做一个终结测试,然后在循环内部有一个指令集,在这个例子中,就是对余数做检查,然后显示信息,当我完成了整个循环。
So, three divided by five is zero, with a remainder of three.
因此,3除以5等于,余数为3。
So, there is more useful purposes than that than just taking remainders.
当然还有一些其他用途,不单单是取余数。
应用推荐