Life, the Universe, and Everything
2015-09-09 22:51
239 查看
Your program is to use the brute-force approach in order to find the Answer to Life, the Universe, and Everything. More precisely... rewrite small numbers from input to output. Stop processing input after reading in the number 42. All numbers at
input are integers of one or two digits.
代码如下:
while True:
n = int(input())
if n != 42:
print(n)
else:
break
input are integers of one or two digits.
Example
Input: 1 2 88 42 99 Output: 1 2 88
代码如下:
while True:
n = int(input())
if n != 42:
print(n)
else:
break
相关文章推荐
- [Effective Java 读书笔记] 第三章 对所有对象都通用的方法 第十---十一条
- JavaScript权威设计--JavaScript变量,作用域,声明提前(简要学习笔记四)
- [LeetCode] Perfect Squares
- AngularJs 在ng-repeat中动态使用ng-model进行双向数据绑定(二)
- node.js querystring处理参数
- JavaScript词法分析过程
- javascript 的预解释机制
- Eclipse去除js(JavaScript)验证错误
- JavaScript之字符串对象
- HTML5学习笔记——1
- 剑指Offer系列---(13)二进制中1的个数
- jquery封装 [ 限制文本框只能输入数字和小数] 语句,简单调用即可
- HTML中引入资源相对路径
- JavaScript序列化和反序列化
- jquery.validate 验证
- AngularJs 在ng-repeat中动态使用ng-model进行双向数据绑定
- js中SetInterval与setTimeout用法
- Index for Html
- JavaScript随笔(二):函数只是一种对象
- 使用PhantomJS实现网页截图服务