摘要: #encoding:utf-8 _author_ = "Wang Wenchao" ''' 现在有n1 +n2种面值的硬币,其中前n1中为普通币, 可以取任意枚,后n2种为纪念币,每种最多只能取一枚, 每种硬币有一个面值,问能有多少种方法拼出m的面值。输入第一行为n1,n2,m第二行和第三行分别为普通币和纪念币的面值 ''' line=raw_input() line=line.split(' ... 阅读全文
posted @ 2018-04-16 18:26 王毅2016 阅读(485) 评论(0) 推荐(0) 编辑
摘要: mysql> select database(); +-------------+ | database() | +-------------+ | myemployees | +-------------+ 1 row in set (0.00 sec) mysql> show tables; +-----------------------+ | Tables_in_myemploye... 阅读全文
posted @ 2018-04-09 16:18 王毅2016 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 进阶7:子查询 含义 一条查询语句中又嵌套了另一条完整的select语句,其中被嵌套的select语句,称为子查询或内查询 在外面的查询语句,称为主查询或外查询 特点: 1、子查询都放在小括号内 2、子查询可以放在 from后面仅仅支持子查询、 select后面支持标量子查询(单行)、 where后 阅读全文
posted @ 2018-04-09 02:14 王毅2016 阅读(734) 评论(0) 推荐(0) 编辑
摘要: #等值连接: 查询员工名和对应的部门名 mysql> select last_name,department_name from employees,departments where employees.department_id=departments.department_id; 查询员工名、 阅读全文
posted @ 2018-04-08 15:33 王毅2016 阅读(295) 评论(0) 推荐(0) 编辑
摘要: 常见函数: mysql> select sum(salary) from employees; + + | sum(salary) | + + | 691400.00 | + + 1 row in set (0.00 sec) mysql> select avg(salary) from emplo 阅读全文
posted @ 2018-04-08 14:39 王毅2016 阅读(506) 评论(0) 推荐(0) 编辑
摘要: 服务开启与停止 net start mysql net stop mysql 服务端登录和退出 mysql (–h lodalhost –P 3306) –u root –p123456 退出 exit 或者ctrl+c MySQL的常见命令 1.查看当前所有的数据库 show databases; 阅读全文
posted @ 2018-04-07 20:38 王毅2016 阅读(178) 评论(0) 推荐(0) 编辑
摘要: #define _CRT_SECURE_NO_DEPRECATE #include<stdio.h> int main() { int year1; char arr[82][82]; char ch[2] = { '@','W' }; int n = 7, f = 0; char x; int i 阅读全文
posted @ 2018-03-20 17:51 王毅2016 阅读(162) 评论(0) 推荐(0) 编辑
摘要: /* 老板给员工发工资,分成n份,每切一刀收取所划分原长度的价格,用花费最少的方案权重最优问题,哈夫曼树 */#也可以考虑小顶堆来求最小的两个数据 #include void ArrSortInsert(int arr[], int n) { int temp; for (int i = 1; i = 0 && arr[j] > temp) { ... 阅读全文
posted @ 2018-03-20 17:42 王毅2016 阅读(209) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> int IsRun(int year) { if(year%4==0&&year%100!=0||year%400==0) return 1; else return 0; } void huafen(int &year,int &month,int &day) 阅读全文
posted @ 2018-03-20 17:40 王毅2016 阅读(266) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include using namespace std; int charToInt(char str[], int n) { int count = 0; for (int i = n - 1; i >= 0; i--) count += (str[i] - '0')*pow(10, n - 1 - i)... 阅读全文
posted @ 2018-01-04 20:20 王毅2016 阅读(651) 评论(0) 推荐(0) 编辑