#36882: python 解題思路


tu.a.yuan.2022@gmail.com (凃阿鳶)

學校 : 新北市立板橋高級中學
編號 : 239751
來源 : [1.162.83.71]
最後登入時間 :
2024-01-23 15:32:58
a005. Eva 的回家作業 -- POJ | From: [1.162.140.251] | 發表日期 : 2023-08-14 14:23

由於輸入有數列的數目,因此可用while或for range進行有限循環

 

運用while count <= n有限循環,count = count+1或 count +=1皆可行

運用map(), int(), input()及split()將輸入賦值給a, b, c, d

運用if/else判斷等差/等比數列

運用a, b, c, d差值得到e

運用print()輸出a, b, c, d, e

 

注意:count記得初始化

注意:input行應為此式樣,a, b, c, d = map(int, input().split())

 
 
ZeroJudge Forum