2015年9月3日

第四章

摘要: 1、数组 sizeof用于整个数组名时将得到整个数组的字节数。初始化:double earnings[4] {}; //所有的元素都为零 unsigned int counts[10]={}; int a[]={1,3,4};2、字符串字符串是以空字符结尾的,空字符被些为\0。字符串... 阅读全文

posted @ 2015-09-03 20:01 RenewDo 阅读(181) 评论(0) 推荐(0) 编辑

twoSum(C++)

摘要: 1 vector twoSum(vector &numbers, int target) 2 { 3 //Key is the number and value is its index in the vector. 4 unordered_map hash; //unorder... 阅读全文

posted @ 2015-09-03 15:02 RenewDo 阅读(233) 评论(0) 推荐(0) 编辑

twoSum

摘要: C方法(用hash) 1 typedef struct HashNode 2 { 3 int key; 4 int val; 5 }HashNode; 6 7 typedef struct HashMap 8 { 9 int size; 10 HashNode** storage; 11 }Hash 阅读全文

posted @ 2015-09-03 08:44 RenewDo 阅读(168) 评论(0) 推荐(0) 编辑

cin.get()让程序可连续输入

摘要: #include "stdafx.h" #include int main(){ using namespace std;int carrots;cout>carrots; cout<<"Here are two more"; carrots=carrots+2; cout<<"Now you ha... 阅读全文

posted @ 2015-09-03 08:38 RenewDo 阅读(856) 评论(0) 推荐(0) 编辑

导航