摘要:
41.题目描述 求1+2+3+...+n,要求不能使用乘除法、for、while、if、else、switch、case等关键字及条件判断语句(A?B:C)。 class Solution { public: int Sum_Solution(int n) { char a[n][n+1]; ret 阅读全文
摘要:
31.题目描述 统计一个数字在排序数组中出现的次数。 思路:找到最低和最高,相减 class Solution { public: int GetNumberOfK(vector<int> data ,int k) { int low=0; int high = data.size()-1; int 阅读全文
摘要:
11.题目描述 输入一个整数,输出该数二进制表示中1的个数。其中负数用补码表示。 class Solution { public: int NumberOf1(int n) { int count = 0; unsigned int num = n; while (num != 0) { if (( 阅读全文
摘要:
首先主从同步,一旦建立,指定了用户,就不能更改了,否则会有错误。1063 Error 'Duplicate entry '%-test-' for key 'PRIMARY'' on query. Default database: 'mysql'. Query: 'INSERT INTO db S 阅读全文