From 1951556e4b4697320114ea10fd133cd7f9fbd592 Mon Sep 17 00:00:00 2001 From: Chenwenxuan Date: Mon, 8 Jul 2024 21:38:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6a8bc10..169d483 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ .vscode -build \ No newline at end of file +build +/.vs +/.vscode +*.exe From f151c946a2188fb224d9785eec2c5f70c1105200 Mon Sep 17 00:00:00 2001 From: Chenwenxuan Date: Mon, 8 Jul 2024 21:38:26 +0800 Subject: [PATCH 2/2] add --- .vscode/c_cpp_properties.json | 3 ++- CMakeLists.txt | 2 +- main.cpp | 40 +++-------------------------------- 3 files changed, 6 insertions(+), 39 deletions(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 092afcc..2e784d1 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -6,7 +6,8 @@ "${workspaceFolder}/**" ], "defines": [], - "intelliSenseMode": "linux-gcc-x64" + "intelliSenseMode": "linux-gcc-x64", + "configurationProvider": "ms-vscode.cmake-tools" } ], "version": 4 diff --git a/CMakeLists.txt b/CMakeLists.txt index e7582cb..5280ba6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0.0) +cmake_minimum_required(VERSION 3.6) project(lc VERSION 0.1.0) include(CTest) diff --git a/main.cpp b/main.cpp index a2aed2c..f9de35e 100644 --- a/main.cpp +++ b/main.cpp @@ -6,42 +6,8 @@ * @LastEditTime: 2022-11-21 21:08:42 */ #include -#include -using namespace std; - -struct ListNode { - int val; - ListNode* next; - // ListNode(int x) : val(x), next(NULL) {} // - ListNode(int x, ListNode* n = NULL) : val(x), next(n) {} -}; - -class Solution { - public: - vector reversePrint(ListNode* head) { - reverse(head); - return (result); - } - - private: - vector result; - void reverse(ListNode* head) { - if (head != nullptr) { - if (head->next != nullptr) { - reversePrint(head->next); - } - result.push_back(head->val); - } - }; -}; - -int main(int, char**) { - - // ListNode* head = new ListNode(1); - // head -> next = new ListNode(3); - // head -> next -> next = new ListNode(2); - - Solution s; - std::cout << s.reversePrint(head)[0] << s.reversePrint(head)[1] << s.reversePrint(head)[2] << std::endl; +int main() { + std::cout << "hello" << std::endl; + return 0; }