Home > Back-end >  Teach children 8
Teach children 8

Time:10-26

[Java]

for (int i=0; i <5; I++)
For (int j=0; J & lt; i; J++)
System. The out. Println (I * j);

The output is (0,0,2,0,3,6,0,4,8,12)
But this process is how to understand!
Thank you for your great kagyu ~

CodePudding user response:

The
refer to the original poster weixin_46253106 response:
but this process is how to understand!
Thank you for your great kagyu ~


This is very simple, substitution method

,1,2,3,4 I={0}
When I=0
J not less than I, not running cycle,
When I=1
J={0}
When I=2
J={0, 1}
When I=3
J={0}
When I=4
,1,2,3 j={0}

The multiplication will do? This will not work hard to learn Java to cough up

CodePudding user response:

reference 1st floor qq_39936465 response:
Quote: refer to the original poster weixin_46253106 response:

But this process is how to understand!
Thank you for your great kagyu ~


This is very simple, substitution method

,1,2,3,4 I={0}
When I=0
J not less than I, not running cycle,
When I=1
J={0}
When I=2
J={0, 1}
When I=3
J={0}
When I=4
,1,2,3 j={0}

The multiplication will do? This will not work hard to learn Java to cough up

Thank you thank you!!!!!
  • Related