其他分享
首页 > 其他分享> > 1053 住房空置率

1053 住房空置率

作者:互联网

题目传送门

#include <iostream>
using namespace std;
int main() 
{
	int n, d, k, may = 0, must = 0;
	double e, t;
	cin >> n >> e >> d;
	for (int i = 0; i < n; i++) 
	{
		cin >> k;
		int sum = 0;
		for (int j = 0; j < k; j++) 
		{
			cin >> t;
			if (t < e) 
			{
				sum++;
			}
		}
		if (sum > (k / 2)) 
		{
			k > d ? must++ : may++;
		}
	}
	double x = (double)may / n * 100;
	double y = (double)must / n * 100;
	printf("%.1f%% %.1f%%", x, y);
	return 0;
}

标签:1053,空置率,may,int,double,sum,住房,++,must
来源: https://blog.csdn.net/qq_43469554/article/details/97153325