自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 收藏
  • 关注

原创 Assign Cookies

#include<vector> #include<algorithm> class Solution { public: int find(std::vector<int>& q, std::vector<int>& s) //这里的& 是引用的意思 { std::sort(q.begin(), q.end()); ...

2019-04-08 23:25:06 93

原创 Valid Pailndrome

Note: For the purpose of this problem, we define empty string as valid palindrome. class Solution { public: bool palindrome(string s) { transform(s.begin(), s.end(), s.begin(), ::tolower); aut...

2019-04-08 00:05:46 70

原创 Remove Duplication from Sorted Array

Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra space for another array, you must do this by modifyin...

2019-04-06 00:06:20 78

原创 two sum

public: vector<int> twoSum(vector<int>& nums, int target) { unordered_map<int,int> hash; for(int i=0;i<nums.size();++i) { int t=target-nums[i];...

2019-04-01 20:55:12 77

原创 acm第一次考试题目重写

#include&lt;iostream&gt; using namespace std; int main() { int M; cin&gt;&gt;M; double A,B,C; for(int i=0;i&lt;M;i++) { cin&gt;&gt;A&gt;&gt;B&gt;&gt;C; if(A+B&gt;C&amp;&amp;A+C&gt;B&amp

2018-12-10 00:07:47 118

原创 第6题

这题考察排序,我采用冒泡排序,用数组来存要输入的字符;刚开始我一时好奇用来cin.get 来输入字符,后来发现我还要想办法取消空格符,自找麻烦。还有两个数比较交换时,我忘记加&amp;了,结果只交换了形参。额,以后要记得地址交换和引用交换 #include using namespace std; #include &lt;stdio.h&gt; void swap(char &amp;x,ch...

2018-12-07 21:21:08 158

原创 第七题

虽然c++从c中发展来的,但是觉得这种情况c中printf("%0.Mf",a); /*将M改为你想保留的几位小数 */更好表示 在这里插入代码片 ```#include&lt;iostream&gt; #include &lt;iomanip&gt; using namespace std; #define PI 3.1415927 double volume(double radius...

2018-12-07 18:21:33 99

原创 第8题

#include&lt;iostream&gt; using namespace std; int main() { int a,b; While(cin&gt;&gt;a&gt;&gt;b) if((a+b)%86==0) cout&lt;&lt;"Yes"&lt;&lt;endl; else cout&lt;&lt;"No"&lt;&a

2018-12-07 17:18:41 163

原创 第四题

这题有给答案,也是最简单的一题。唯一的难点是怎么表示多行输入后多行输出。有想过用循环让结果返回,可是没有成功,从这道题学到while的妙用,也不亏了 #include&lt;iostream&gt; using namespace std; int main() { double A,B ; while(cin&gt;&gt;A&gt;&gt;B) { cout&lt;&lt;A+B...

2018-12-07 17:13:53 78

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除