python蓝桥比赛(选拔赛中高级组20230112)真题(2)!
2023-02-15 17:52
views:
1234
source:
4664946
a=input()
a=int(a)
if a%2==0:
for i in range(2):
print(a//2)
else:
print(a//2)
print(a//2+1)
#附题目
#给定一个正整数(2<=N<=1000),
#请将N拆分成两个正整数A和B,且A和B尽量接近(N=A+B,A>=B,且A减B的值最小)
#例如N=5,拆分成3和2
#输入:
#输入一个正整数N(2<=N<=1000)
#输出:
#第一行输出一个正整数,表示拆分后的A
#第二行输出一个正整数,表示拆分后的B
#后记:我是当时的一个考生,此题为真题之一,其余见我的其他文章
Disclaimer: The above articles are added by users themselves and are only for typing and communication purposes. They do not represent the views of this website, and this website does not assume any legal responsibility. This statement is hereby made! If there is any infringement of your rights, please contact us promptly to delete it.