I have a program where there are three parameters. So:
These three parameters are positions within m_aluno[w_i][w_j][w_k]);
, where w_i
can receive a position informed by the user or not and this is for w_j
and w_k
also; My problem is where, if you enter a value for w_i
and then w_j
and w_k
are empty, only w_j
and w_k
that it will start in 0
o will be iterated. w_i
must stay in the informed position!
My case is, "I want to add a repeat loop only when I need it. How do I do this?"
I played JSFiddle with all as condições
for better visualization (it was supposed to work, but I can not edit to execute the function first).
So there are três for's
:
for (w_i=0; w_i<w_ii; w_i++) //primeiro
{
for (w_j=0; w_j<w_jj; w_j++) //segundo
{
for (w_k=0; w_k<w_kk; w_k++) //terceiro
{
- If
w_i
does not start in0
the firstfor
has to disappear. - If
w_j
does not start in0
secondfor
has to disappear. - If
w_k
does not start in% with% third0
has to disappear.
The for
will not start in 0 unless you enter some value for them.