1. 程式人生 > 實用技巧 >除數函式求和 1(分塊+尤拉篩)

除數函式求和 1(分塊+尤拉篩)

# 輸入檔名
# oldFileName = input("請輸入要拷檔案的檔名字:")
# # 以讀的方式開啟檔案
# oldFile = open(oldFileName,'rb')
# 提取檔案的字尾
# fileFlagNum = oldFileName.rfind('.')
# if fileFlagNum > 0:
# fileFlag = oldFileName[fileFlagNum:]
# 組織新的檔名字
# newFileName = oldFileName[:fileFlagNum] + '-bakcup' + fileFlag
# 建立新檔案
# newFile = open(newFileName, 'wb')

# 把舊檔案中的資料,一行行復制到新檔案中
# for lineContent in oldFile.readlines():
# newFile.write(lineContent)
# 關閉檔案
# oldFile.close()
# newFile.close()

# f = open("1909c2", mode="r", encoding="utf-8")
# print(f.readlines())
# f.close()

# file_name = input("請輸入要開啟的檔案")
# file_1 = open(file_name,"r")
# link = file_1.readlines()

# print(link)
# i = 0
# list_1 = []
# s = 0
# o = 0
# for j in link:
# k = int(j[len(j) -3] + j[len(j) - 2])
# s += k
#
#
# if k > 60:
# # print((j[j.index(",")]))
# d = j.index(",")
# print("%s超過了60分"%(j[0:d]))
# if j[0:d][0] == "L":
# print("%s的名字是'L'開頭的"%j[0:d])

# print("總分是%s" % s)