Користувач вводить свою температуру.
Якщо вона менша 20 градусів або більше 46,то console("Ви труп").
Якщо від 20 - 27 градусів - ви у комі, від 27 до 36 або 37 до 42, ви хворі, якщо від 36 до 37 - ви здорові, якщо від 42 до 46 - ви втратили свідомість.
Людина вводить дробові числа 36,6.
С++


asilvejstruk: Если человек мертвый или в коме, то как он введет в прогу свою температуру
asilvejstruk: switch case юзай

Ответы

Ответ дал: leprekon882
2

#include <iostream>

using namespace std;

int main() {

double temperature;

cout << "Enter your temperature: ";

cin >> temperature;

if (temperature < 20 || temperature > 46) {

cout << "You are dead." << endl;

} else if (temperature >= 20 && temperature <= 27) {

cout << "You are in coma." << endl;

} else if ((temperature >= 27 && temperature <= 36) || (temperature >= 37 && temperature <= 42)) {

cout << "You are sick." << endl;

} else if (temperature > 36 && temperature < 37) {

cout << "You are healthy." << endl;

} else if (temperature >= 42 && temperature <= 46) {

cout << "You have lost consciousness." << endl;

}

return 0;

}

Вас заинтересует