一张纸的厚度是0.09毫米,对折多少次过后可以超过珠穆朗玛峰的高度,也就是大于8848米?
收起
【有帮助请采纳】
#位运算方法解决(位运算只能算整数,所以我扩大了一下) counter = 0 s = 9 while True: s <<= 1 counter += 1 if s > 884800000: break print(counter) #27
#普通方式解决 counter = 0 s = 9 while True: s *= 2 counter += 1 if s > 884800000: break print(counter) #27
报告相同问题?