目录
87.题目:回答结果(结构体变量传递)
88.题目:读取7个数(1—50)的整数值,每读取一个值,程序打印出该值个数的*
87.题目:回答结果(结构体变量传递)
#87
class student:x = 0c = 0
def f(stu):stu.x = 20stu.c = 'c'
a= student()
a.x = 3
a.c = 'a'
print(a.x,a.c)
f(a)
print(a.x,a.c)
返回:
88.题目:读取7个数(1—50)的整数值,每读取一个值,程序打印出该值个数的*
#88
n = 1
while n <= 7:a = int(input('请输入一个数字:'))while a < 1 or a > 50:a = int(input('请输入一个数字:'))print(a * '*')n += 1
返回: