3.16 PAT1053 乙级 python

住房空置率

n,e,d = map(float,input().split())
emp = 0
memp = 0
for i in range(int(n)):
	low = 0
	lst = [float(i) for i in input().split()]
	for k in lst[1:]:
		if k < e:
			low += 1
	if lst[0]>d and low/lst[0]>0.5:
		emp += 1
	elif low/lst[0]>0.5:
		memp += 1
print('%.1f%% %.1f%%'%(memp/n*100,emp/n*100))

 

你可能感兴趣的:(PAT,乙级,python)