随笔分类 -  剑指offer

剑指offer部分题解答
摘要:#include<iostream> using namespace std; // 题目:数组中只有不多于两个数字出现次数是奇数次,其他都是偶数次,求出出现奇数次的数字(不含0的数组) //思想: /* (1)如果只有一个数字是奇数次,直接对数组进行按位异或运算,得到的结果就是该数 (2)如果有俩 阅读全文
posted @ 2015-09-10 16:48 fchy822 阅读(1388) 评论(0) 推荐(0)
摘要:#includeusing namespace std;int countOfNumFromSortArr(int arr[],int len,int num);int main(){ int arr[]={0,1,1,2,2,2,2,3,3,3,4}; int n; cin>>n; ... 阅读全文
posted @ 2015-09-09 21:49 fchy822 阅读(249) 评论(0) 推荐(0)
摘要:#include#include#includeusing namespace std;char firstStrAppearOne(const char* str);// 第一个只出现一次的字符void str1MinusStr2(char* str1,const char* str2);// 删... 阅读全文
posted @ 2015-09-09 16:19 fchy822 阅读(282) 评论(0) 推荐(0)