Commit bb02eb45 by BellCodeEditor

auto save

parent f12ea14f
n = int(input())
s = str(n*n)
a = str(n)
if (n*n - n)%(10^len(a)) == 0:
print("Y")
else:
print("N")
\ No newline at end of file
n = int(input())
m = n*n
while n != 0:
if n % 10 == m % 10:
n = n // 10
m = m // 10
else:
print("N")
break
if n == 0:
print("Y")
\ No newline at end of file
a = int(input())
b = []
for i in range(1,a+1):
if a%i == 0:
b.append(i)
if len(b)>2:
print("N")
else:
print("Y")
\ No newline at end of file
a = int(input())
for i in range(2,a):
if a%i == 0:
print('N')
break
print('Y')
break
\ No newline at end of file
a = int(input())
b = int(input())
if a < b:
for i in range(a,0,-1):
if a%i == 0 and b%i == 0:
print('gcd(' + str(a) + ',' + str(b) + ')' + '=' + str(i))
break
elif a > b:
for i in range(b,0,-1):
if b%i == 0 and a%i == 0:
print('gcd(' + str(a) + ',' + str(b) + ')' + '=' + str(i))
break
else:
print(a)
\ No newline at end of file
def ex(x,y):
temp = x
x = y
y = temp
def gcd(m,n):
if m>n:
ex(m,n)
for i in range(m,0,-1):
if m%i == 0 and n%i == 0:
return i
a = int(input())
b = int(input())
print("gcd(%d,%d)=%d" %(a,b,gcd(a,b)))
\ No newline at end of file
def ex(x,y):
temp = x
x = y
y = temp
def gbs(m,n):
if m<n:
ex(m,n)
flag = 0
i = m-1
while flag != 1:
i += 1
if i%m == 0 and i%n == 0:
flag = 1
return i
a = int(input())
b = int(input())
print("gbs(%d,%d)=%d" %(a,b,gbs(a,b)))
\ No newline at end of file
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment