# 墩墩大题8「嘉兴大学Python期末补救计划」

AI悦创原创Python 一对一教学嘉兴大学PythonPython 一对一教学嘉兴大学Python大约 4 分钟...约 1317 字

## Question 1

3,5

``````print("请输入 a 和 n，用英文逗号分隔：")
``````

### Solution 1

1
``````print("请输入 a 和 n，用英文逗号分隔：")
a, n = map(int, input().strip().split(','))

s = 0
temp = 0
for i in range(n):
temp = temp * 10 + a
s += temp

print(s)
``````

## Question 2

``````i = 0
daughter = 12
father = 30

while father <= 2 * daughter:
daughter = daughter + 1
father = father + 1
i = i + 1
print("Year, father,daughter", i, father, daughter)
``````

### Solution 2

``````i = 0
daughter = 12
father = daughter + 30

while father != 2 * daughter:
daughter = daughter + 1
father = father + 1
i = i + 1
print("Year, father, daughter:", i, father, daughter)
``````

### 思路

1. 女儿当前年龄是 12 岁。
2. 父亲比女儿大 30 岁，所以父亲的当前年龄是 42 岁。

`父亲的年龄 = 2 * 女儿的年龄`

AI悦创·编程一对一

AI悦创·推出辅导班啦，包括「Python 语言辅导班、C++ 辅导班、java 辅导班、算法/数据结构辅导班、少儿编程、pygame 游戏开发、Web、Linux」，全部都是一对一教学：一对一辅导 + 一对一答疑 + 布置作业 + 项目实践等。当然，还有线下线上摄影课程、Photoshop、Premiere 一对一教学、QQ、微信在线，随时响应！微信：Jiabcdefh

C++ 信息奥赛题解，长期更新！长期招收一对一中小学信息奥赛集训，莆田、厦门地区有机会线下上门，其他地区线上。微信：Jiabcdefh

• 0
• 0
• 0
• 0
• 0
• 0

• 按正序
• 按倒序
• 按热度