add: 230321-CN

This commit is contained in:
Eatswap 2023-03-21 23:45:22 +08:00
parent e785f9fff0
commit 5fb0da597d
Signed by: Eatswap
GPG Key ID: BE661106A1F3FA0B
2 changed files with 17 additions and 1 deletions

16
cpp/2303/230321-CN.cpp Normal file
View File

@ -0,0 +1,16 @@
#include <vector>
/**
* 2469. Convert the Temperature
*
* You are given a non-negative floating point number rounded to two decimal places celsius, that denotes the temperature in Celsius.
* You should convert Celsius into Kelvin and Fahrenheit and return it as an array ans = [kelvin, fahrenheit].
* Return the array ans. Answers within 10-5 of the actual answer will be accepted.
*/
class Solution {
public:
static std::vector<double> convertTemperature(double c) {
return {c + 273.15, c * 1.8 + 32.0};
}
};

View File

@ -3,4 +3,4 @@ PROJECT(2303)
SET(CMAKE_CXX_STANDARD 23)
ADD_EXECUTABLE(2303 230320.cpp)
ADD_EXECUTABLE(2303 230321-CN.cpp)