Skip to content

sugarlxn/leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leetcode work space

中文 / English

这是一个用于平时WSL中测试CPP、python、shell等各种代码的测试目录,包括leetcode代码记录,所以它的内容分布会显得很杂,

如何使用

这个工作目录主要代码有main.cpp、main.py, 可以通过makefile很方便对这个工作区运行和测试

  1. 编译运行CPP程序,查看makefile不难发现,可以使用make run 一键编译和运行main.cpp
make run
  1. 运行python程序,也可如此,这些像快捷方法一样的make 命令,能够在测试过程中最快的启动测试代码
make runpy
  1. 当然,如果你不知道makefile该怎么写,或者说该如何使用,我强烈建议你看这个tutorial:https://makefiletutorial.com/

  2. 该工作空间还添加了cmake_ws,使用CMakeLists.txt 比编写一个makefile 更快捷,更方便,也更有效,我也强烈建议你使用CMakeLists.txt 来构建C++项目,如果你不知道如何编写一个CMakeLists.txt ,我建议你去看这个tutorial:https://cmake.org/cmake/help/latest/guide/tutorial/index.html。使用CMake构建C++项目也很简单,只需要以下这几个步骤:①编写C++源文件。②编写CMakeLists.txt。③执行cmake,make。以reference_counter为例子

#git clone this project
#if dir build is not exit, then you can create a dir named build by "mkdir build"
cd 2reference_counter/build
cmake ..
make 
#到此在build目录下将会生成项目的可执行文件target

贡献

PRs accepted.

许可证

MIT © Richard McRichface