08 2022 档案
摘要:(21条消息) 023:Fun和Do_Simon_Paul的博客-CSDN博客 1 #include <iostream> 2 using namespace std; 3 class A { 4 private: 5 int nVal; 6 public: 7 void Fun() 8 { cou
阅读全文
摘要:(21条消息) C++面向对象程序设计 020:继承自string的MyString (北大Mooc)(含注释)_Love 6的博客-CSDN博客 1 #include <cstdlib> 2 #include <iostream> 3 #include <string> 4 #include <a
阅读全文
摘要:(21条消息) C++编程练习 013:魔兽世界之一:备战_德林恩宝的博客-CSDN博客 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 using namespace std; 5 #define WARRIOR_N
阅读全文
摘要:1 #include <iostream> 2 using namespace std; 3 class A { 4 public: 5 int val; 6 A(int n = 123):val(n){} 7 A& GetObj(){return *this;} 8 }; 9 int main()
阅读全文
摘要:1 #include <iostream> 2 using namespace std; 3 4 struct A 5 { 6 int v; 7 A(int vv):v(vv) { } 8 const A* getPointer()const {return this;} 9 }; 10 11 in
阅读全文
摘要:1 #include <iostream> 2 using namespace std; 3 class Sample { 4 public: 5 int v; 6 Sample(int n = 0):v(n){}; //设置缺省值为0,没有初值时初始化v = 0 7 Sample(const Sa
阅读全文
摘要:1.1393.股票的资本损益 i. 1 # Write your MySQL query statement below 2 SELECT 3 stock_name,SUM(CASE WHEN operation = 'Buy' THEN -price ELSE price END) capital
阅读全文
摘要:7-1.1141.查询近30天活跃用户数 i.使用DATEDIFF COUNT里使用的是user_id而不是session_id,因为要查询的是用户数,虽然说每个 session_id 只属于一个用户,但是每个用户可能拥有多个session_id DATEDIFF除了限制<30,还要限制>=0不然会
阅读全文
摘要:5-1.175.组合两个表 1)左联结(left outer join),联结结果保留左表的全部数据 2)右联结(right outer join),联结结果保留右表的全部数据 3)内联结(inner join),取两表的公共数据 1 # Write your MySQL query stateme
阅读全文
摘要:https://www.cnblogs.com/lyq105/archive/2009/11/28/1612677.html
阅读全文
摘要:1.1667.修复表中的名字 【JMao】简单函数解法+分享刷题经验 - 修复表中的名字 - 力扣(LeetCode) 1 # Write your MySQL query statement below 2 SELECT user_id,CONCAT(UPPER(LEFT(name,1)),LOW
阅读全文
摘要:1.1965.丢失信息的雇员 1 # Write your MySQL query statement below 2 SELECT 3 employee_id 4 FROM 5 Employees 6 WHERE 7 employee_id not in (select employee_id f
阅读全文
摘要:1.力扣1873.计算特殊奖金 case when: 【SQL】SQL中Case When的用法 - HDWK - 博客园 (cnblogs.com) if : 语法结构:IF(expr,v1,v2) 其中:表达式 expr 为条件式,当 expr 为真是返回 v1 的值,否则返回 v2 i.cas
阅读全文
摘要:622. 设计循环队列 - 力扣(LeetCode) C语言 1 typedef struct { 2 int front; 3 int rear; 4 int capcity; 5 int* Elements; 6 } MyCircularQueue; 7 8 9 MyCircularQueue*
阅读全文
摘要:1.力扣595.大的国家 i. 1 # Write your MySQL query statement below 2 select name,population,area from World 3 where area >= 3000000 or population >= 25000000;
阅读全文
摘要:三种情况: 1.左半部分(leftsum)最大(与右边不连续,不一定包括mid) 2.右半部分(rightsum)最大(与左边不连续,不一定包括mid+1) 3.左右部分联合最大(左右两边连续,包括mid) 1和2是前面返回的(与另一边不连续 !!!,左半部分不一定是包含mid 以mid结尾的,右半
阅读全文
摘要:CommonPre函数:把字符串数组一分为二,分别求出左右两边数组的最长公共前后缀 left 和 right,然后将两者进行比较得到最终的 最长公共前后缀 1 class Solution { 2 public: 3 string longestCommonPrefix(vector<string>
阅读全文