SPOJ Python DAY1: Life, the Universe, and Everything

时间:2014-06-25 22:39:23   收藏:0   阅读:282

博主学统计的,学编程多属自学,且入门角度刁钻。用了3年R,深感有掌握一门外语的必要。最近把自己强力掰弯到Python上来,加之自己算法,数据结构学的也十分业余,故拿SPOJ练练手。

刷题之旅开始了。。。

1. Life, the Universe, and Everything

题目用的是STAR TREK 的梗,题目本身很简单,个人觉得也比通常OJ中a+b的开头更有趣些。就是打印输入的整数,遇42停。

##### Filename: SPOJ_1 #####
# Life, the Universe, and Everything
n = int(input())
while n != 42:
  print(n)
  n = int(input()) #Try to understand the meaning of loops and input method
Technorati Tags: ,

SPOJ Python DAY1: Life, the Universe, and Everything,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!