1. There is a chessboard, there are 64 squares, in the first box to put 1 sesame seed weight is 0.00001kg, the second inside put 2, the third inside put 4, the board on the weight of all sesame
<script>var sum=0; // The first weight is set at 0; for (i=1;i<=64;i++) { var a=1; // starting at 2 of the 0-time square for (j=0;j<i-1;j++) { a=a*2; } Sum=sum+A;} Alert (0.00001*sum)
2. Badminton racket 15 yuan, ball 3 yuan, water 2 yuan. $200 each at least one, how much could it be
var cs=0; // var str= "; for (i=1;i<=13;i++) // Each one must have at least one, so start looping from 1 { for (j=1;j<=66;j++" { for (N=1;n<=100;n++ =15*i+3*j+2*n; if (Sum==200 +=1; STR +=i+ "Badminton Racket" +j+ "ball" +n+ "bottle of Water" + "| |" }}}}alert (CS) alert (str)
3 100 or less of 7 related
var str= ""; for (i=0;i<=100;i++) { if(i%7==0| | i%10==7| | parseint (i%10) ==7) { str=str+i+ "| |" }}alert (str)
Application of the For loop in JavaScript