SPOJ Python DAY1: Life, the Universe, and Everything

博主学统计的,学编程多属自学,且入门角度刁钻。用了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
posted @ 2014-06-23 18:31  雾谷客  阅读(184)  评论(0编辑  收藏  举报