You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
628 B

#include <bits/stdc++.h>
using namespace std;
struct Person {
string name; //姓名
float temperature; //体温
int cough; //咳嗽
};
int main() {
int n, count = 0;
cin >> n;
//声明动态数组
Person *person = new Person[n];
for (int i = 0; i < n; ++i) {
cin >> person[i].name >> person[i].temperature >> person[i].cough;
if (person[i].temperature >= 37.5 && person[i].cough) {
cout << person[i].name << endl;
count++;
}
}
cout << count << endl;
// 删除动态数组
delete[]person;
return 0;
}