作业: 1.使用while循环输入1 2 3 4 5 6 8 9 10(没有7) n = 1 while n < 11: if n == 7: pass else: print(n) n = n + 1 print('结束') 2.求1-100所有数的和 n = 1 s = 0 while n < 101: s = s + n n = n + 1 print(s) 3.输出1-100的所有奇数 n = 1 while n <101: print(n) n = n + 2 print('结…
1.一张纸的厚度是0.0001米,将纸对折,对折多少次厚度超过珠峰高度8848米 解法一: var gd = 8848; var cs = 0; while(true) { cs++; gd = gd*0.5 if(gd<0.0001) { break; } } alert(cs); 解法二: var n = 0; var g = 0.0001; while(true) { g = g *2; n++ if(g>8848) { break } } alert(n); 解法三: var n =…