File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 2
2
* 2469
3
3
* Convert the Temperature
4
4
**
5
- * You are given a non-negative floating point number rounded to two decimal places celsius, that denotes the temperature in Celsius.
5
+ * You are given a non-negative floating point number rounded to two decimal places Celsius,
6
+ * that denotes the temperature in Celsius.
6
7
* You should convert Celsius into Kelvin and Fahrenheit and return it as an array ans = [kelvin, fahrenheit].
7
8
*
8
9
* Return the array ans. Answers within 10-5 of the actual answer will be accepted.
20
21
* Input: celsius = 122.11
21
22
* Output: [395.26000,251.79800]
22
23
* Explanation: Temperature at 122.11 Celsius converted in Kelvin is 395.26 and converted in Fahrenheit is 251.798.
24
+ *
25
+ * Constraints:
26
+ * • 0 <= celsius <= 1000
23
27
**
24
28
* https://leetcode.com/problems/convert-the-temperature/
25
29
***/
@@ -31,6 +35,6 @@ public class ConvertTheTemperature
31
35
{
32
36
public double [ ] ConvertTemperature ( double celsius )
33
37
{
34
- return new double [ ] { celsius + 273.15 , celsius * 1.8 + 32 } ;
38
+ return [ celsius + 273.15 , celsius * 1.8 + 32 ] ;
35
39
}
36
40
}
You can’t perform that action at this time.
0 commit comments