#include using namespace std; const int kEauationVal = 32; template void getVal(const char text[], T *val); int main() { float fahrenheit = 0, schritt_weite = 0, maximal_wert = 0; cout << "Eingabe\n\n"; getVal("Fahrenheit", &fahrenheit); getVal("Schrittweite", &schritt_weite); getVal("Maximalwert", &maximal_wert); cout << "\nAusgabe\n\n"; for (int i = fahrenheit; i <= maximal_wert; i += schritt_weite) { float celsius_wert = ((i - kEauationVal) * 5) / 9; cout << "Celsius: " << celsius_wert; if (celsius_wert <= 10) cout << " es ist kalt"; else if (celsius_wert <= 20) cout << " es ist angenehm"; else if (celsius_wert > 20) cout << " es ist heiss"; cout << endl; } do { cout << "Fahrenheit: " << fahrenheit << " | Celsius: " << ((fahrenheit - kEauationVal) * 5) / 9 << endl; fahrenheit += schritt_weite; } while (fahrenheit <= maximal_wert); for (int i = fahrenheit; i <= maximal_wert; i += schritt_weite) { float celsius_wert = ((fahrenheit - kEauationVal) * 5) / 9; cout << "Celsius: " << celsius_wert; if (celsius_wert <= 10) cout << " es ist kalt"; else if (celsius_wert <= 20) cout << " es ist angenehm"; else if (celsius_wert > 20) cout << " es ist heiss"; cout << endl; } return 0; } template void getVal(const char text[], T *val) { do { cout << "\t" << text << " = "; if (cin.fail()) { cin.clear(); cin.ignore(); } cin >> *val; } while (cin.fail() || *val <= 0); }