- 博客(8)
- 资源 (1)
- 收藏
- 关注
原创 C++ leetcode刷题复盘7: merge two sorted lists
解法参考:https://www.cnblogs.com/grandyang/p/4086297.html相关知识:1.链表
2021-01-12 12:00:55 118
原创 C++ leetcode刷题复盘4: roman_to_int
参考资料:https://blog.csdn.net/magicdoubi/article/details/86561355相关知识:1.string数据调用2.break用法解法一有问题还没改class Solution {public: int romanToInt(string s) { char r[7]={'I','V','X','L','C','D','M'}; int n[7]={1,5,10,50,100,500,1000}; int res =
2021-01-10 12:44:42 121
原创 C++ leetcode刷题复盘3: palindrome number
参考资料:https://www.cnblogs.com/whale90830/p/10531209.html相关知识:1.数值转字符串to_string()函数2.return直接强制结束函数解法一使用字符串转换符to_string,注意return可以提前终止函数。class Solution {public: bool isPalindrome(int x) { if (x<0){return false;} string x1 =
2021-01-09 15:30:30 113
原创 C++ leetcode刷题复盘2: reverse
参考资料:https://www.cnblogs.com/grandyang/p/4125588.html相关知识:1.INT_MAX2.除法与取余3.三目运算符解法一class Solution {public: int reverse(int x) { int result=0; while (x!=0){ if(abs(result) > INT_MAX/10) return 0;//保证数据翻转过来不会超过最大数
2021-01-08 14:34:40 119
原创 C++ leetcode刷题复盘1: two sum
代码参考:https://www.cnblogs.com/grandyang/p/4130379.html相关学习基础知识参考:1.C/C++ 定义向量、赋值和使用2.unordered_map原理3.unordered_map使用解法1使用暴力解法,相关有vector的定义与赋值。class Solution {public: vector<int> twoSum(vector<int>& nums, int target) { ve
2021-01-07 20:52:19 330
原创 C++从零入门(一):vscode环境搭建
vscode环境搭建参考:https://blog.csdn.net/moshiyaofei/article/details/103183742https://blog.csdn.net/iningwei/article/details/101649090vscode c++安装还装了这个mingw64安装软件下载http://mingw-w64.org/doku.php/download具体设置:安装完成后需要系统环境变量中加入\bin确认是否安装成功:编译环境搭建ct
2021-01-06 16:43:56 193
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人