#反转一个三位数
class Solution:
# def __init__(self,num=0):
# self.num=num
def reverseInteger(self,num):
a=int(num/100)
b=int(num%100/10)
c=int(num%10)
return (c*100+b*10+a)
if __name__=='__init__':
s=Solution()
print(s.reverseInteger(456))
#合并排序数组
class Solution:
def __init__(self):
self.A=A
self.B=B
def mergeSortedArray(self,A,B):
i=0
j=0
C=[]
while i<len(A)and j<len(B):
if A[i]<B[j]:
C.append(A[i])
i+=1
else:
C.append(B[j])
j+=1
while i<len(A):
C.append(A[i])
i+=1
while j<len(B):
C.append(B[j])
j+=1
return C
s=Solution()
A=[1,3,5]
B=[1,2,4,5,6]
print(s.mergeSortedArray(A,B))
# if __name__=='__main__':
# s=Solution()
# A=[1,3,5]
# B=[2,4,5,6]
# s1=s.mergeSortedArray(A,B)
# print(s1)