#include <iostream> using namespace std; // Write your code here float readTemp(int raw){ float temp = static_cast<float>(raw) * 0.1; return temp; } float readTemp(int raw, char unit){ float temp = static_cast<float>(raw) * 0.1; if(unit == 'C'){ return temp; } if (unit == 'F'){ return temp * 1.8 + 32; } } int main() { int raw; char unit; cin >> raw >> unit; if (unit == 'D') { cout << readTemp(raw); } else { cout << readTemp(raw, unit); } return 0; }
Test Cases
Test Results
Input
250 D
Expected Output
25