請輸入你的學號 (Write your student ID number) 例如:S05430210,請記得以S開頭。
CP1-L01
Problem 1
x=19
y=5
z=x%y
print 'z=',z
for i in range(1,30):
a=i%y
if(a == 0): print i
sum1,sum2=0,0
for i in range(1,30):
if(i%y > 2):
sum1 += i
else:
sum2 += i
print 'sum1=',sum1
print 'sum2=',sum2
(a)Z=_
可嘗試次數(no. of submission)= 2
01
(b)sum1=____
可嘗試次數(no. of submission)= 2
02
(c)sum2=___
可嘗試次數(no. of submission)= 2
03
Problem 2
N=4
sum=0
for i in range(1, N+1):
sum+=i
print 'sum=',sum
print 'exact=',N*(###)/2
sum=_____
可嘗試次數(no. of submission)= 3
04
如果我們想要加一個精確的(exact)求和公式在這個計算當中,請你將程式當中#字號的部分取代為正確的文字=___
可嘗試次數(no. of submission)= 3
05
Problem 3
N=1
for i in range(1, 5):
N*=i
print 'N=',N
N=____
可嘗試次數(no. of submission)= 3
06
Problem 4
sum=0
for i in range(1, 5):
sum+=i**2
print 'sum=',sum
sum=____
可嘗試次數(no. of submission)= 3
07
Problem 5
sum=0
for i in range(1, 5):
sum+=i*(i+1)
print 'sum=',sum
sum=____
可嘗試次數(no. of submission)= 3
08
Problem 6
import math
PI=math.pi
print 'PI=',PI
x=PI/3.
print 'sin(x)=',math.sin(x)
print 'cos(x)=',math.cos(x)
PI=____
可嘗試次數(no. of submission)= 3
09
sin(x)=____
可嘗試次數(no. of submission)= 3
10
cos(x)=____
可嘗試次數(no. of submission)= 3
11
Problem 7
N=13
for i in range(1,N,2):
print i
######The output is:
1
3
5
7
9
11
13
15
####the output we want:
1
5
9
13
##### the code for you to complete
N=16
FFF i in RRRRR(1,AAA):
BBBBBBB
FFF=___
可嘗試次數(no. of submission)= 3
12
RRRRR=_____
可嘗試次數(no. of submission)= 3
13
AAA=___
可嘗試次數(no. of submission)= 5
14
BBBBBBB=_______
可嘗試次數(no. of submission)= 5
15
利用下面這個連結你可以查詢你得分的情況,成績查詢網頁每30秒更新一次。
成績查詢連結