更新6-10,优化文件结构

This commit is contained in:
Luthics 2022-09-07 22:37:10 +08:00
parent 1c4db6aabb
commit 6f8e1e0456
10 changed files with 30 additions and 0 deletions

View File

6
codes/10.py Normal file
View File

@ -0,0 +1,6 @@
n = int(input())
sum = 0
for i in range(n):
if((i+1) % 7 == 0 and (i+1) % 13 != 0):
sum += i+1
print(sum)

View File

View File

View File

View File

5
codes/6.py Normal file
View File

@ -0,0 +1,5 @@
n = int(input())
sum = 0
for i in range(n):
sum += i+1
print(sum)

5
codes/7.py Normal file
View File

@ -0,0 +1,5 @@
n = int(input())
sum = 0
for i in range(n):
sum += (i+1)**2
print(sum)

6
codes/8.py Normal file
View File

@ -0,0 +1,6 @@
n = int(input())
sum = 0
for i in range(n):
if((i+1) % 2==1):
sum += i+1
print(sum)

8
codes/9.py Normal file
View File

@ -0,0 +1,8 @@
n = int(input())
sum = 0
for i in range(n):
tmp = 1
for j in range(i+1):
tmp *= j+1
sum += tmp
print(sum)