#include <iostream> using namespace std; // Write your code here float readTemp(int raw) { return raw/10.0f; } float readTemp(int raw, char unit) { float temp = readTemp(raw); if (unit == 'C') { return temp; } else { 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