摘要:
本次博客,我将记录遍历string的三种方式 1.for循环下标遍历: //.size() string str="abcdefg"; for(int i=0;i<str.size();i++){ cout<<str[i]<<' '; } //.length() string str="abcdef 阅读全文

posted @ 2022-07-26 11:59
Sky6634
阅读(4319)
评论(0)
推荐(0)
摘要:
今天开始将记录自己学习LeedCode的过程 题目链接:两数之和 本题如果用暴力解法很简单: class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { vector<int> ans; for(int i 阅读全文

posted @ 2022-07-26 11:28
Sky6634
阅读(36)
评论(0)
推荐(0)