Home  >  Article  >  Backend Development  >  循环内的公式不一致如何写一个函数

循环内的公式不一致如何写一个函数

WBOY
WBOYOriginal
2016-06-13 10:11:14726browse

循环内的公式不一致怎么写一个函数?
for()
 {
  for()
  {
  值1=式1;
  }
 }

for()
 {
  for()
  {
  值2=式2(值1);
  }
 }


实际循环有5层..
式2必须得到值1才能计算值2.


能不能写一个类似.
function 函数1 (字符串参数)
{}

函数1(式1);

这样把表达式带进去?

或者有其他解决办法?

难道要把整个多重循环复制多次?- -

------解决方案--------------------
for中的条件影响 式1、式2 的计算吗?
不太明白……
------解决方案--------------------
难道不是这样的?
for()
 {
for()
{
值1=式1;
for()
{
for()
{
值2=式2(值1);
}
}
}
 }

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn