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.

34 lines
751 B

#include <bits/stdc++.h>
using namespace std;
bool judge(float x, int y);
int main() {
int n;
float temperature[201];
int cough[201];
string name[201];
int sum = 0;
int i;
cin >> n;//输入病人数
for (i = 1; i <= n; i++)//依次输入姓名、体温、是否咳嗽
cin >> name[i] >> temperature[i] >> cough[i];
for (i = 1; i <= n; i++)
if (judge(temperature[i], cough[i]))//进行判断
{
cout << name[i] << endl;//输出姓名
sum++;//总数+1
}
cout << sum << endl;//输出总数
return 0;
}
bool judge(float x, int y) {
if ((x >= 37.5) && (y == 1))
return true;
else
return false;
}