Professional Documents
Culture Documents
M NG
M NG
a=[]
def sochan(n):
if n%2==0:
return True
else:
return False
for i in range(n):
a.append(so)
for i in range(n):
if sochan(a[i]):
print(a[i])
Bài 2: UCLN
while m!=n:
if m>n:
m=m-n
else:
n=n-m
print("UCLN:",m)
Bài 3: Số nguyên tố
a=[]
def songuyento(m):
dem=0
b=m
if (b%k==0):
dem=dem+1
if dem==1:
return True
else:
return False
for i in range(n):
a.append(so)
for i in range(len(a)):
if songuyento(a[i]):
a=[]
def sodao(m):
a=""
b=m
while b!=0:
c=0
c=b%10
a=a+str(c)
b=b//10
return a
for i in range(n):
a.append(so)
for i in range(len(a)):
def UCLN(m,n):
while m!=n:
if m>n:
m=m-n
else:
n=n-m
return m