SRM 299 Div2-250pt: TemperatureScales
解法
やるだけ。
class TemperatureScales { public: double convert(int f1, int b1, int f2, int b2, int t) { double r = (double)(t-f1)/(b1-f1); return (double)r*(b2-f2) + f2; }
やるだけ。
class TemperatureScales { public: double convert(int f1, int b1, int f2, int b2, int t) { double r = (double)(t-f1)/(b1-f1); return (double)r*(b2-f2) + f2; }