![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode(c++)
Guoliang Li
这个作者很懒,什么都没留下…
展开
-
d3;c++中cin与cout
#include <iostream>//using namespace std;int main() { char buf[20]; cin.ignore(7); //去掉第7个 cin.getline(buf,10); //再拿走10个 std::cout << buf << std::endl;}获取...原创 2019-01-10 23:13:05 · 139 阅读 · 0 评论 -
leetcode,01 Two Sum两数之和,c++
Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution,and you may not use the same...原创 2019-01-10 23:15:17 · 95 阅读 · 0 评论 -
d1,数组求和,C/C++,对比
1.数组求和,c2.指针版,c3.数组求和,c++原创 2019-01-07 18:19:45 · 596 阅读 · 0 评论 -
leetcode2两数相加,c++
class Solution {public: ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) { ListNode *result = new ListNode(0); ListNode *tmp = result; int sum = 0; while(l1 || ...原创 2019-01-12 23:39:59 · 127 阅读 · 0 评论 -
leetcode 7. 反转整数(c++)
Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21Note:Assume we are dealing with...原创 2019-01-13 21:42:58 · 223 阅读 · 1 评论 -
d2,输入数字求和,过滤空格,c/c++对比
例如:输入10 10 10 10,过滤空格,输出40c++实现#include&amp;amp;amp;lt;iostream&amp;amp;amp;gt;using namespace std;int main() { int sum=0; cout &amp;amp;amp;lt;&amp;amp;amp;lt; &amp;amp;quot;原创 2019-01-08 21:48:08 · 202 阅读 · 0 评论