自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Reverse a sentence

#include using namespace std;char sentence[] = "i like this program";//1.reverse all chars//2.rever only words.void revese_char(char* _string) { char* start = _string; char* end = start; w

2016-07-12 06:17:34 276

原创 String to Integer

int myAtoi(string str) { double x = 0; bool neg = false; int index = 0; int len = str.size(); bool foundNumber = false; while (index < len ) { //if str start with spaces if (str[index] ==

2016-05-12 04:18:16 305

原创 最大盛水量

Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two

2016-05-10 07:57:11 784

原创 randomize a vector

void shuffle(vector & vect, int size){ int i = 0; int temp = 0, index = size - 1; srand(time(nullptr)); while(index > 0){ i = rand() % (index + 1); temp = vect[in

2016-02-14 03:29:17 295

原创 Longest Palindromic Substring(最长回文子串)

string findLongestPalindrome(string & str){ size_t n = str.size(); size_t max_length = 0; size_t len = 0; size_t start = 0; if(n <= 1){ return str; } for(size_

2016-02-02 07:39:04 239

原创 3. Longest Substring Without Repeating Characters

int lengthOfLongestSubstring(string s) { int n = s.size(); if (n <= 1) { return n; } int i = 0;//start of the current checking string int j = 1;//end of the current checking string int len =

2016-01-28 15:53:48 292

原创 移除vector中重复的元素

移除vectoer中重复的元素

2016-01-28 04:14:32 462

原创 总结遍历二维数组的方式

#include #include #include #include #include using namespace std;int tl(){ return 2;}int main(){ constexpr int row = 2, col = 3; int arr[row][col] = {1,2,3,4,5,6}; for

2016-01-24 09:05:29 395

原创 2 - Add Two Numbers

You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link

2016-01-22 13:44:32 190

原创 1 - Two Sum

Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, where

2016-01-22 12:21:21 248

原创 OpenGL学习笔记(一)

#include #include static GLfloat spin = 0.0;void init(){ glClearColor(0.0, 0.0, 0.0, 0.0); glShadeModel(GL_FLAT);}void display(){ glClear(GL_COLOR_BUFFER_BIT); glPushMatrix(); glRotatef(spin, 0.0, 0.0

2014-03-02 23:59:53 523

空空如也

空空如也

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

TA关注的人

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