1 <html lang="en">
 2 <head>
 3     <meta charset="UTF-8">
 4     <meta name="viewport" content="width=device-width, initial-scale=1.0">
 5     <meta http-equiv="X-UA-Compatible" content="ie=edge">
 6     <title>控制流的问题</title>
 7 </head>
 8 <body>
 9 <script>
10     // 1--100的奇数和
11     var sum=0;
12     for(var i=0; i<=100;i++){
13         if(i%2==1){
14          sum+=i
15         }
16        
17     }
18     document.write(sum+"<br/>")
19     //求1--100的偶数和
20     var sum=0;
21     for(var j=0;j<=100;j++){
22         if(j%2==0){
23             sum+=j
24         
25         }
26        
27     }
28     document.write(sum+"<br/>")
29     //输出倒置的久久乘法表
30     document.write("<table border='1'cellpadding='0' width='80%'>")
31          for(var i=9;i>=1;i--){
32              document.write("<tr>")
33                 for(var j=1;j<=i;j++){
34                    document.write("<td>" + i+'*'+j+'='+(i*j)+"</td>") 
35                 }
36                 document.write("</tr>")
37          }
38         document.write("</table>")
39     
40     </script>    
41 </body>
42 </html>