From 560be468b6ee11507921db2d62ad18d5cfe68c14 Mon Sep 17 00:00:00 2001 From: 1AoB <2453468739@qq.com> Date: Thu, 25 Apr 2024 14:34:38 +0800 Subject: [PATCH] c++ --- .../content/post/给个offer/index.zh-cn.md | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/exampleSite/content/post/给个offer/index.zh-cn.md b/exampleSite/content/post/给个offer/index.zh-cn.md index 73485ca..d0d3aa1 100644 --- a/exampleSite/content/post/给个offer/index.zh-cn.md +++ b/exampleSite/content/post/给个offer/index.zh-cn.md @@ -240,3 +240,43 @@ public: +# 7.21. 斐波那契数列 + +```cpp +//f[i] = f[i-1]+f[i-2] +class Solution { +public: + int Fibonacci(int n) { + + } +}; +``` + +# 8.78. 左旋转字符串 + +```cpp +//先把整个进行翻转 +//再把前(总-个数),后两部分进行翻转 +class Solution { +public: + string leftRotateString(string str, int n) { + + } +}; +``` + +# 9.87. 把字符串转换成整数 + +```cpp +//分步 +//过滤掉行首空格 +//long long +//判断这个数是不是负数 +class Solution { +public: + int strToInt(string str) { + + } +}; +``` +