ZOJ1049
這題的大概題意是在X軸上選一點,半圓以每年50平方英里的速度擴張,求何時所選的點被半圓覆蓋。思路也很簡單就是求點所在的半圓面積與50的倍數,直接上代碼。
<span style="font-family:SimSun;font-size:14px;">#2015-02-02
# -*- coding: utf-8 -*-
n = int(input())
i = 1
while i <= n:
a = []
line = raw_input()
for x in line.split():
a.append(float(x))
r = a[0]*a[0] + a[1]*a[1]
s = r*3.14/2
flag = int(s)/50 + 1
print 'Property %d: This property will begin eroding in year %d.' % (i,flag)
i += 1
print 'END OF OUTPUT.'
</span>
多做幾道OJ題目後大家就會發現列表就像C中的數組一樣,非常重要,一定要熟練使用。