Răspuns :
Explicație:
1:
n=int(input())
s=0
for i in range(1,n+1):
if i%2!=0:
s=s+i
print(s)
2:
p=int(input())
for i in range(100,1000):
d=0
for j in range(1,i+1):
if i%j==0:
d=d+1
if d==2:
k=i
c1=k%10
k=k//10
c2=k%10
c3=k//10
if c1*c2*c3==p:
print(i)
3:
x=int(input())
y=int(input())
for i in range(x,y+1):
sd1=0
sd2=0
for j in range(x,y+1):
sd1=0
sd2=0
for d in range(1,i+1):
if i%d==0:
sd1=sd1+d
for d in range(1,j+1):
if j%d==0:
sd2=sd2+d
if i!=j and sd1==sd2:
print("("+str(i)+","+str(j)+")")
5:
for i in range(100,1000):
v=i
c3=v%10
v=v//10
c2=v%10
c1=v//10
if c1<c2 and c2<c3 and c1+c2+c3==18:
print(i)
6:
x=int(input())
f=2
max=1
while x>1:
p=0
while x%f==0:
x=x//f
p=p+1
if p>max :
max=p
a=f
f=f+1
print(a)
Încerc să rezolv și 4