===============for ,while 打印 1 到100的和<script> var i=1; var JG=0; while (i<101){ JG+=i; i++; } console.log(‘while结果‘,JG); var n; var JG2=0; for (n=1;n<101;n++) { JG2+=n; } console.log(‘for 结果‘,JG2) </script>
时间: 2024-10-03 21:51:38
===============for ,while 打印 1 到100的和<script> var i=1; var JG=0; while (i<101){ JG+=i; i++; } console.log(‘while结果‘,JG); var n; var JG2=0; for (n=1;n<101;n++) { JG2+=n; } console.log(‘for 结果‘,JG2) </script>