自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 打卡5(回文数)

class Solution { public: bool isPalindrome(int x) { if (x < 0 || (x % 10 == 0 && x != 0)) { return false; } int a = 0; while (x > a) { a = a * 10 + x % 10; x /= 10; } if(x==a) return true; if((a/10)==x) return true; else return false; } };

2020-06-16 23:18:54 80

原创 第四天打卡(两数之和)

class Solution { public: vector twoSum(vector& nums, int target) { for(int i = 0;i < nums.size()-1;i ++) { for(int j = i+1;j < nums.size();j++) { if(nums[i] + nums[j] == target) { return {i,j}; } } } return {}; } };

2020-06-14 16:42:14 139

原创 第三天打卡(爬楼梯)

class Solution { public: int climbStairs(int n) { int a=1,b=2,c; if(n1) c=1; if(n2) c=2; for(int i=3;i<=n;i++){ c=a+b; a=b; b=c; } return c; } };

2020-06-13 15:34:45 110

空空如也

空空如也

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

TA关注的人

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