当前位置: 首页> 财经> 访谈 > 网页主题设计思路及制作步骤_电商创业_全渠道营销的概念_广州官方新闻

网页主题设计思路及制作步骤_电商创业_全渠道营销的概念_广州官方新闻

时间:2025/8/26 19:14:21来源:https://blog.csdn.net/CH3CH2CH4/article/details/143643355 浏览次数:0次
网页主题设计思路及制作步骤_电商创业_全渠道营销的概念_广州官方新闻

121. 买卖股票的最佳时机

【参考代码】

动态规划解决

class Solution {
public:int maxProfit(vector<int>& prices) {int size = prices.size();int min_price = 99999, max_profit = 0;for(int i=0; i<size; i++){if(prices[i] < min_price){min_price = prices[i];}else if(prices[i] - min_price > max_profit){max_profit = prices[i] - min_price;}}return max_profit;}
};

125. 验证回文串

【参考代码】

class Solution {
public:bool isPalindrome(string s) {string s1 = "";int size = s.size();if(size == 0){return true;}for(char c : s){if(isalnum(c)){s1 += tolower(c);}}string temp = s1;reverse(temp.begin(), temp.end());if(temp == s1){return true;}else{return false;}}
};
关键字:网页主题设计思路及制作步骤_电商创业_全渠道营销的概念_广州官方新闻

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: