如何执行每5个结果的动作? [英] How to perform an action every 5 results?
本文介绍了如何执行每5个结果的动作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
基本上我只是在中为循环执行一个动作试图模拟一个5列的表。
解决方案
您可以使用模数运算符
$ b (i%0 == 0)
$ b $ $ $ $ $ $ $ {
//在这里做你的事情
}
}
How can I perform an action within a for
loop every 5 results?
Basically I'm just trying to emulate a table with 5 columns.
解决方案
you could use the modulus operator
for(int i = 0; i < 500; i++)
{
if(i % 5 == 0)
{
//do your stuff here
}
}
这篇关于如何执行每5个结果的动作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文