From 5fb0da597de8128c9e691c891c1bfd67fdb9a52f Mon Sep 17 00:00:00 2001 From: Eatswap Date: Tue, 21 Mar 2023 23:45:22 +0800 Subject: [PATCH] add: 230321-CN --- cpp/2303/230321-CN.cpp | 16 ++++++++++++++++ cpp/2303/CMakeLists.txt | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 cpp/2303/230321-CN.cpp diff --git a/cpp/2303/230321-CN.cpp b/cpp/2303/230321-CN.cpp new file mode 100644 index 0000000..426ac55 --- /dev/null +++ b/cpp/2303/230321-CN.cpp @@ -0,0 +1,16 @@ +#include + +/** + * 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 convertTemperature(double c) { + return {c + 273.15, c * 1.8 + 32.0}; + } +}; \ No newline at end of file diff --git a/cpp/2303/CMakeLists.txt b/cpp/2303/CMakeLists.txt index ae545eb..a6a12de 100644 --- a/cpp/2303/CMakeLists.txt +++ b/cpp/2303/CMakeLists.txt @@ -3,4 +3,4 @@ PROJECT(2303) SET(CMAKE_CXX_STANDARD 23) -ADD_EXECUTABLE(2303 230320.cpp) +ADD_EXECUTABLE(2303 230321-CN.cpp)