求助!!!!!0分
查看原帖
求助!!!!!0分
750418
cheng110527楼主2023/2/14 13:26
#include <iostream>

using namespace std;

int main(){
	double high,low;
	int one = 0,two = 0,three = 0,four = 0,five = 0,six = 0,n;
	cin >> n;
	for (int i = 1;i <= n;i++){
		cin >> high >> low;
		if (high >= 35) one++;
		if (high >= 30 && high < 35) two++;
		if (high >= 25 && high < 30) three++;
		if (low >= 25) four++;
		if (high >= 0 && low < 0) five++;
		if (low < 0) six++;
	}
	cout << one << " " << two << " " << three << " " << four << " " << five << " " << six;
	return 0;
}
2023/2/14 13:26
加载中...