#include <iostream> using namespace std; // Write your code here float readTemp(int raw){ raw=raw/10; return static_cast<float>raw; } float readTemp(int raw ,char unit){ raw=raw/10; if(unit== 'C'){ return static_cast<float>raw; }else if(unit=='F'){ raw= raw *1.8 +32; return static_cast<float>raw; } } 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