Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- // Coded by Username77177 with ♥ for Goal Gesture
- int main(int argc, char *argv[])
- {
- cout << "1 - Fahrenheit to Celsius;\n2 - Celsius to Fahrenheit;\n3 - Celsius to Kelvin\n4 - Kelvin to Celsius\n: ";
- float choice;
- while (int(choice) != 1 && int(choice) != 2 && int(choice) != 3 && int(choice) != 4)
- {
- cin >> choice;
- }
- if (choice == 1) {
- cout << "Введите температуру в Фаренгейтах:";
- cin >> choice;
- choice = (choice - 32) * 5 / 9;
- }
- else if (choice == 2)
- {
- cout << "Введите температуру в Цельсиях:";
- cin >> choice;
- choice = ((choice/5)*9) + 32;
- }
- else if (choice == 3)
- {
- cout << "Введите температуру в Цельсиях:";
- cin >> choice;
- choice += 273.15;
- }
- else {
- cout << "Введите температуру в Кельвинах:";
- cin >> choice;
- choice -= 273.15;
- }
- cout << "Полученная температура: " << choice << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment